Commit c5b1972b authored by Eric Anholt's avatar Eric Anholt

DRI XFree86-4_3_99_12-merge import

parent 41eba03d
.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810.man,v 1.5 2003/10/18 02:27:07 dawes Exp $
.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810.man,v 1.4 2003/07/29 20:59:06 dawes Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH I810 __drivermansuffix__ __vendorversion__
......@@ -14,7 +14,7 @@ i810 \- Intel 8xx integrated graphics chipsets
.fi
.SH DESCRIPTION
.B i810
is an __xservername__ driver for Intel integrated graphics chipsets.
is an XFree86 driver for Intel integrated graphics chipsets.
The driver supports depths 8, 15, 16 and 24. All visual types are
supported in depth 8. For the i810/i815 other depths support the
TrueColor and DirectColor visuals. For the 830M and later, only the
......@@ -28,7 +28,7 @@ supports the i810, i810-DC100, i810e, i815, 830M, 845G, 852GM, 855GM,
and 865G chipsets.
.SH CONFIGURATION DETAILS
Please refer to __xconfigfile__(__filemansuffix__) for general configuration
Please refer to XF86Config(__filemansuffix__) for general configuration
details. This section only covers configuration details specific to this
driver.
.PP
......@@ -50,8 +50,7 @@ DRI is enabled. This amount may be changed with the
entry in the config file
.B "Device"
section. It may be set to any reasonable value up to 64MB for older
chipsets or 128MB for newer chipets. It is advisable to check the
__xservername__
chipsets or 128MB for newer chipets. It is advisable to check the XFree86
log file to check if any features have been disabled because of insufficient
video memory. In particular, DRI support or tiling mode may be disabled
with insufficient video memory. Either of these being disabled will
......@@ -73,8 +72,7 @@ Disable or enable acceleration. Default: acceleration is enabled.
.TP
.BI "Option \*qSWCursor\*q \*q" boolean \*q
Disable or enable software cursor. Default: software cursor is disable
and a hardware cursor is used for configurations where the hardware cursor
is available.
and a hardware cursor is used.
.TP
.BI "Option \*qColorKey\*q \*q" integer \*q
This sets the default pixel value for the YUV video overlay key.
......@@ -88,7 +86,7 @@ textures. Increasing it can improve 2D performance at the expense of
Default: depends on the resolution, depth, and available video memory. The
driver attempts to allocate at least enough to hold two DVD-sized YUV buffers
by default. The default used for a specific configuration can be found
by examining the __xservername__ log file.
by examining the XFree86 log file.
.TP
.BI "Option \*qDRI\*q \*q" boolean \*q
Disable or enable DRI support.
......@@ -117,13 +115,6 @@ The following driver
.B Options
are supported for the 830M and later chipsets:
.TP
.BI "Option \*qVBERestore\*q \*q" boolean \*q
Enable or disable the use of VBE save/restore for saving and restoring
the initial text mode. This is disabled by default because it causes
lockups on some platforms. However, there are some cases where it must
enabled for the correct restoration of the initial video mode. If you are
having a problem with that, try enabling this option. Default: Disabled.
.TP
.BI "Option \*qVideoKey\*q \*q" integer \*q
This is the same as the
.B \*qColorKey\*q
......@@ -131,14 +122,14 @@ option described above. It is provided for compatibility with most
other drivers.
.TP
.BI "Option \*qXVideo\*q \*q" boolean \*q
Disable or enable XVideo support. Default: XVideo is enabled for
configurations where it is supported.
Disable or enable XVideo support.
Default: XVideo is enabled for configurations where it is supported.
.SH "SEE ALSO"
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
.SH AUTHORS
Authors include: Keith Whitwell, and also Jonathan Bian, Matthew J Sottek,
Jeff Hartmann, Mark Vojkovich, Alan Hourihane, H. J. Lu. 830M and 845G
support reworked originally for XFree86 4.3 by David Dawes and Keith Whitwell.
support reworked for XFree86 4.3 by David Dawes and Keith Whitwell.
852GM, 855GM, and 865G support added by David Dawes and Keith Whitwell.
......@@ -27,7 +27,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/common.h,v 1.9 2003/09/24 02:43:23 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/common.h,v 1.7 2003/06/18 13:14:17 dawes Exp $ */
/*
* Authors:
......@@ -79,11 +79,7 @@ extern const char *I810vbeSymbols[];
extern const char *I810ddcSymbols[];
extern const char *I810fbSymbols[];
extern const char *I810xaaSymbols[];
#ifdef XF86DRI
extern const char *I810driSymbols[];
extern const char *I810drmSymbols[];
extern const char *I810shadowSymbols[];
#endif
extern void I830DPRINTF_stub(const char *filename, int line,
const char *function, const char *fmt, ...);
......@@ -115,8 +111,7 @@ extern void I830DPRINTF_stub(const char *filename, int line,
#define OUT_RING(n) do { \
if (I810_DEBUG & DEBUG_VERBOSE_RING) \
ErrorF( "OUT_RING %lx: %x, (mask %x)\n", \
(unsigned long)(outring), (unsigned int)(n), ringmask); \
ErrorF( "OUT_RING %x: %x, (mask %x)\n", outring, n, ringmask); \
*(volatile unsigned int *)(virt + outring) = n; \
outring += 4; \
outring &= ringmask; \
......@@ -232,24 +227,21 @@ extern void I830DPRINTF_stub(const char *filename, int line,
#define OUTREG8(addr, val) do { \
*(volatile CARD8 *)(RecPtr->MMIOBase + (addr)) = (val); \
if (I810_DEBUG&DEBUG_VERBOSE_OUTREG) { \
ErrorF("OUTREG8(0x%lx, 0x%lx) in %s\n", (unsigned long)(addr), \
(unsigned long)(val), FUNCTION_NAME); \
ErrorF("OUTREG8(0x%x, 0x%x) in %s\n", addr, val, FUNCTION_NAME); \
} \
} while (0)
#define OUTREG16(addr, val) do { \
*(volatile CARD16 *)(RecPtr->MMIOBase + (addr)) = (val); \
if (I810_DEBUG&DEBUG_VERBOSE_OUTREG) { \
ErrorF("OUTREG16(0x%lx, 0x%lx) in %s\n", (unsigned long)(addr), \
(unsigned long)(val), FUNCTION_NAME); \
ErrorF("OUTREG16(0x%x, 0x%x) in %s\n", addr, val, FUNCTION_NAME); \
} \
} while (0)
#define OUTREG(addr, val) do { \
*(volatile CARD32 *)(RecPtr->MMIOBase + (addr)) = (val); \
if (I810_DEBUG&DEBUG_VERBOSE_OUTREG) { \
ErrorF("OUTREG(0x%lx, 0x%lx) in %s\n", (unsigned long)(addr), \
(unsigned long)(val), FUNCTION_NAME); \
ErrorF("OUTREG(0x%x, 0x%x) in %s\n", addr, val, FUNCTION_NAME); \
} \
} while (0)
......@@ -257,10 +249,8 @@ extern void I830DPRINTF_stub(const char *filename, int line,
* preprocessor symbol, and equal to zero.
*/
#if 1
#ifndef I810_DEBUG
#define I810_DEBUG 0
#endif
#endif
#ifndef I810_DEBUG
#warning "Debugging enabled - expect reduced performance"
extern int I810_DEBUG;
......
......@@ -264,13 +264,9 @@ typedef struct _I810Rec {
#define I810_SELECT_BACK 1
#define I810_SELECT_DEPTH 2
#ifdef XF86DRI
extern Bool I810DRIScreenInit(ScreenPtr pScreen);
extern void I810DRICloseScreen(ScreenPtr pScreen);
extern Bool I810DRIFinishScreenInit(ScreenPtr pScreen);
extern Bool I810DRILeave(ScrnInfoPtr pScrn);
extern Bool I810DRIEnter(ScrnInfoPtr pScrn);
#endif
extern Bool I810InitDma(ScrnInfoPtr pScrn);
extern Bool I810CleanupDma(ScrnInfoPtr pScrn);
......
......@@ -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_accel.c,v 1.21 2004/01/02 20:22:17 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c,v 1.19 2003/04/24 18:00:24 eich Exp $ */
/*
* Reformatted with GNU indent (2.2.8), using the following options:
......@@ -48,9 +48,47 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "xf86_ansic.h"
#include "xf86.h"
#include "xaarop.h"
#include "i810.h"
static unsigned int i810Rop[16] = {
0x00, /* GXclear */
0x88, /* GXand */
0x44, /* GXandReverse */
0xCC, /* GXcopy */
0x22, /* GXandInvert */
0xAA, /* GXnoop */
0x66, /* GXxor */
0xEE, /* GXor */
0x11, /* GXnor */
0x99, /* GXequiv */
0x55, /* GXinvert */
0xDD, /* GXorReverse */
0x33, /* GXcopyInvert */
0xBB, /* GXorInverted */
0x77, /* GXnand */
0xFF /* GXset */
};
static unsigned int i810PatternRop[16] = {
0x00, /* GXclear */
0xA0, /* GXand */
0x50, /* GXandReverse */
0xF0, /* GXcopy */
0x0A, /* GXandInvert */
0xAA, /* GXnoop */
0x5A, /* GXxor */
0xFA, /* GXor */
0x05, /* GXnor */
0xA5, /* GXequiv */
0x55, /* GXinvert */
0xF5, /* GXorReverse */
0x0F, /* GXcopyInvert */
0xAF, /* GXorInverted */
0x5F, /* GXnand */
0xFF /* GXset */
};
static void I810SetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
int pattx, int patty,
int fg, int bg, int rop,
......@@ -92,7 +130,10 @@ I810AccelInit(ScreenPtr pScreen)
pI810->bufferOffset = 0;
infoPtr->Flags = LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS;
infoPtr->Flags |= PIXMAP_CACHE;
/* There is a bit blt bug in 24 bpp. This is a problem, but
* at least without the pixmap cache we can pass the test suite */
if (pScrn->depth != 24)
infoPtr->Flags |= PIXMAP_CACHE;
/* Sync
*/
......@@ -293,7 +334,7 @@ I810SetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
/* Color blit, p166 */
pI810->BR[13] = (BR13_SOLID_PATTERN |
(XAAPatternROP[rop] << 16) |
(i810PatternRop[rop] << 16) |
(pScrn->displayWidth * pI810->cpp));
pI810->BR[16] = color;
}
......@@ -339,7 +380,7 @@ I810SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop,
if (xdir == -1)
pI810->BR[13] |= BR13_RIGHT_TO_LEFT;
pI810->BR[13] |= XAACopyROP[rop] << 16;
pI810->BR[13] |= i810Rop[rop] << 16;
pI810->BR[18] = 0;
}
......@@ -360,12 +401,9 @@ I810SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1,
* This was developed empirically so it may not catch all
* cases.
*/
#define I810_MWIDTH 8
if ( !(pI810->BR[13] & BR13_RIGHT_TO_LEFT) && (y2 - y1) < 3
&& (y2 - y1) >= 0 && (x2 - x1) <= (w + I810_MWIDTH)
&& (w > I810_MWIDTH))
w = I810_MWIDTH;
&& (y2 - y1) >= 0 && (x2 - x1) <= (w + 4) && (w > 4))
w = 4;
do {
if (pI810->BR[13] & BR13_PITCH_SIGN_BIT) {
......@@ -403,10 +441,7 @@ I810SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1,
break;
x2 += w;
x1 += w;
if (w_back > I810_MWIDTH)
w = I810_MWIDTH;
else
w = w_back;
w = w_back;
} while (1);
}
......@@ -425,9 +460,9 @@ I810SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int pattx, int patty,
pI810->BR[18] = bg;
pI810->BR[19] = fg;
pI810->BR[13] = (pScrn->displayWidth * pI810->cpp);
pI810->BR[13] |= XAAPatternROP[rop] << 16;
pI810->BR[13] |= i810PatternRop[rop] << 16;
if (bg == -1)
pI810->BR[13] |= BR13_MONO_PATN_TRANS;
pI810->BR[13] |= BR13_MONO_TRANSPCY;
}
static void
......@@ -489,7 +524,7 @@ I810SetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
fg, bg, rop, planemask);
pI810->BR[13] = (pScrn->displayWidth * pI810->cpp);
pI810->BR[13] |= XAACopyROP[rop] << 16;
pI810->BR[13] |= i810Rop[rop] << 16;
pI810->BR[13] |= (1 << 27);
if (bg == -1)
pI810->BR[13] |= BR13_MONO_TRANSPCY;
......
......@@ -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_cursor.c,v 1.6 2002/09/11 00:29:31 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_cursor.c,v 1.7 2002/10/30 12:52:17 alanh Exp $ */
/*
* Reformatted with GNU indent (2.2.8), using the following options:
......
......@@ -34,7 +34,7 @@
* with <TAB> characters expanded at 8-column intervals.
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dga.c,v 1.5 2002/09/11 00:29:31 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dga.c,v 1.6 2003/02/26 04:19:36 dawes Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
......
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c,v 1.41 2003/09/24 02:43:23 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c,v 1.40 2003/07/09 01:45:23 dawes Exp $ */
/*
* Reformatted with GNU indent (2.2.8), using the following options:
*
......@@ -522,7 +522,7 @@ I810DRIScreenInit(ScreenPtr pScreen)
drmAgpAlloc(pI810->drmSubFD, 4096 * 1024, 1, NULL, &dcacheHandle);
pI810->dcacheHandle = dcacheHandle;
xf86DrvMsg(pScreen->myNum, X_INFO, "[agp] dcacheHandle : 0x%lx\n",
xf86DrvMsg(pScreen->myNum, X_INFO, "[agp] dcacheHandle : %p\n",
dcacheHandle);
#define Elements(x) sizeof(x)/sizeof(*x)
......@@ -1424,83 +1424,3 @@ static void I810DRITransitionTo2d(ScreenPtr pScreen)
}
pI810->have3DWindows = 0;
}
Bool
I810DRILeave(ScrnInfoPtr pScrn)
{
I810Ptr pI810 = I810PTR(pScrn);
if (pI810->directRenderingEnabled) {
if (pI810->dcacheHandle != 0)
if (drmAgpUnbind(pI810->drmSubFD, pI810->dcacheHandle) != 0) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"%s\n",strerror(errno));
return FALSE;
}
if (pI810->backHandle != 0)
if (drmAgpUnbind(pI810->drmSubFD, pI810->backHandle) != 0) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"%s\n",strerror(errno));
return FALSE;
}
if (pI810->zHandle != 0)
if (drmAgpUnbind(pI810->drmSubFD, pI810->zHandle) != 0) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"%s\n",strerror(errno));
return FALSE;
}
if (pI810->sysmemHandle != 0)
if (drmAgpUnbind(pI810->drmSubFD, pI810->sysmemHandle) != 0) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"%s\n",strerror(errno));
return FALSE;
}
if (pI810->xvmcHandle != 0)
if (drmAgpUnbind(pI810->drmSubFD, pI810->xvmcHandle) != 0) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"%s\n",strerror(errno));
return FALSE;
}
if (pI810->cursorHandle != 0)
if (drmAgpUnbind(pI810->drmSubFD, pI810->cursorHandle) != 0) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"%s\n",strerror(errno));
return FALSE;
}
if (pI810->agpAcquired == TRUE)
drmAgpRelease(pI810->drmSubFD);
pI810->agpAcquired = FALSE;
}
return TRUE;
}
Bool
I810DRIEnter(ScrnInfoPtr pScrn)
{
I810Ptr pI810 = I810PTR(pScrn);
if (pI810->directRenderingEnabled) {
if (pI810->agpAcquired == FALSE)
drmAgpAcquire(pI810->drmSubFD);
pI810->agpAcquired = TRUE;
if (pI810->dcacheHandle != 0)
if (drmAgpBind(pI810->drmSubFD, pI810->dcacheHandle,
pI810->DepthOffset) != 0)
return FALSE;
if (pI810->backHandle != 0)
if (drmAgpBind(pI810->drmSubFD, pI810->backHandle,
pI810->BackOffset) != 0)
return FALSE;
if (pI810->zHandle != 0)
if (drmAgpBind(pI810->drmSubFD, pI810->zHandle,
pI810->DepthOffset) != 0)
return FALSE;
if (pI810->sysmemHandle != 0)
if (drmAgpBind(pI810->drmSubFD, pI810->sysmemHandle, 0) != 0)
return FALSE;
if (pI810->xvmcHandle != 0)
if (drmAgpBind(pI810->drmSubFD, pI810->xvmcHandle,
pI810->MC.Start) != 0)
return FALSE;
if (pI810->cursorHandle != 0)
if (drmAgpBind(pI810->drmSubFD, pI810->cursorHandle,
pI810->CursorStart) != 0)
return FALSE;
}
return TRUE;
}
......@@ -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) {
......
......@@ -32,7 +32,7 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_hwmc.c,v 1.3 2001/12/04 21:17:56 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_hwmc.c,v 1.4 2002/09/11 00:29:32 dawes Exp $ */
#include "xf86.h"
......
......@@ -24,7 +24,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_io.c,v 1.4 2002/01/25 21:56:04 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_io.c,v 1.5 2002/09/11 00:29:32 dawes Exp $ */
/*
* Reformatted with GNU indent (2.2.8), using the following options:
......
......@@ -149,7 +149,7 @@ I810AllocateGARTMemory(ScrnInfoPtr pScrn)
pI810->DcacheKey = key;
if (!xf86BindGARTMemory(pScrn->scrnIndex, key, tom)) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Allocation of %ld bytes for DCACHE failed\n", size);
"Allocation of %d bytes for DCACHE failed\n", size);
pI810->DcacheKey = -1;
} else {
pI810->DcacheMem.Start = tom;
......@@ -159,7 +159,7 @@ I810AllocateGARTMemory(ScrnInfoPtr pScrn)
}
} else {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"No physical memory available for %ld bytes of DCACHE\n",
"No physical memory available for %d bytes of DCACHE\n",
size);
pI810->DcacheKey = -1;
}
......@@ -188,7 +188,7 @@ I810AllocateGARTMemory(ScrnInfoPtr pScrn)
pI810->HwcursKey = key;
if (!xf86BindGARTMemory(pScrn->scrnIndex, key, tom)) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Allocation of %ld bytes for HW cursor failed\n", size);
"Allocation of %d bytes for HW cursor failed\n", size);
pI810->HwcursKey = -1;
} else {
pI810->CursorPhysical = physical;
......
......@@ -497,7 +497,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define BR13_RIGHT_TO_LEFT 0x40000000
#define BR13_LEFT_TO_RIGHT 0x00000000
#define BR13_MONO_TRANSPCY 0x20000000
#define BR13_MONO_PATN_TRANS 0x10000000
#define BR13_USE_DYN_DEPTH 0x04000000
#define BR13_DYN_8BPP 0x00000000
#define BR13_DYN_16BPP 0x01000000
......
......@@ -23,7 +23,7 @@ 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_video.c,v 1.26 2003/11/10 18:22:22 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c,v 1.24 2003/09/08 14:25:29 eich Exp $ */