Xorg R6.8.1 Lockup
Matthias Hopf
mhopf at suse.de
Mon Oct 25 07:45:54 PDT 2004
On Oct 21, 04 10:56:12 -0400, listmail at voltar-confed.org wrote:
> I am having the exact same trouble by the way. I can't use xorg at
> all and have switched back to xfree. With agpgart and the i180 kernel
> modules loaded I get various kinds of lockups, including (but not
> limited to) the one listed below.
>
> I get hardware lockups even without the kernel modules loaded. I hve
> no idea what happens with those...
Does this still happen with the latest CVS as well?
We fixed a couple of i810 related bugs, they should all be in the CVS
now. Anyway, find 4 patches attached, they hopefully work against your
trees. Again, these patches should already be in the CVS.
Hope this helps
Matthias
--
Matthias Hopf <mhopf at suse.de> /-- /-- /-- mat at mshopf.de
Maxfeldstr. 5 / 90409 Nuernberg \-\ | | \-\ |-- www.mshopf.de
Phone +49-911-74053-715 --/ \_/ --/ \-- labs
-------------- next part --------------
Index: i830_driver.c
===================================================================
RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c,v
retrieving revision 1.1.1.23
diff -u -r1.1.1.23 i830_driver.c
--- i830_driver.c 2 Aug 2004 13:30:42 -0000 1.1.1.23
+++ i830_driver.c 20 Sep 2004 18:57:22 -0000
@@ -593,8 +593,12 @@
{
I830Ptr pI830 = I830PTR(pScrn);
vbeInfoPtr pVbe = pI830->pVbe;
+ Bool status;
CARD32 temp;
+
#ifdef I915G_WORKAROUND
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ vgaRegPtr vgaReg = &hwp->SavedReg;
int getmode;
int mode;
switch (pScrn->depth) {
@@ -620,9 +624,14 @@
DPRINTF(PFX, "SetDisplayDevices: devices 0x%x\n", devices);
#ifdef I915G_WORKAROUND
- if (pI830->bios_version >= 3272) {
- VBEGetVBEMode(pVbe, &getmode);
- I830VESASetVBEMode(pScrn, mode, NULL);
+ if (pI830->bios_version >= 3272 && pI830->bios_version < 3306) {
+ /* Save/restore VGA text mode fonts in case user has special ones */
+ if (pI830->preinit) {
+ vgaHWUnlock(hwp);
+ vgaHWSave(pScrn, vgaReg, VGA_SR_FONTS);
+ }
+ VBEGetVBEMode(pVbe, &getmode);
+ I830VESASetVBEMode(pScrn, mode, NULL);
}
#endif
@@ -632,18 +641,17 @@
pVbe->pInt10->cx = devices;
xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn);
- if (Check5fStatus(pScrn, 0x5f64, pVbe->pInt10->ax)) {
-#ifdef I915G_WORKAROUND
- if (pI830->bios_version >= 3272)
- I830VESASetVBEMode(pScrn, getmode, NULL);
-#endif
- return TRUE;
- }
+ status = Check5fStatus(pScrn, 0x5f64, pVbe->pInt10->ax);
#ifdef I915G_WORKAROUND
- if (pI830->bios_version >= 3272)
- I830VESASetVBEMode(pScrn, getmode, NULL);
+ if (pI830->bios_version >= 3272 && pI830->bios_version < 3306) {
+ I830VESASetVBEMode(pScrn, getmode, NULL);
+ vgaHWRestore(pScrn, vgaReg, VGA_SR_FONTS);
+ if (pI830->preinit) vgaHWLock(hwp); /* when preinit restore to org */
+ }
#endif
+ if (status)
+ return TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"SetDisplayDevices call failed, writing config directly to SWF0.\n");
@@ -1602,6 +1610,7 @@
return FALSE;
hwp = VGAHWPTR(pScrn);
+
pI830->cpp = pScrn->bitsPerPixel / 8;
pI830->preinit = TRUE;
-------------- next part --------------
diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/common.h programs/Xserver/hw/xfree86/drivers/i810/common.h
--- programs/Xserver/hw/xfree86/drivers/i810_old/common.h 2004-09-29 16:03:59.645813735 +0200
+++ programs/Xserver/hw/xfree86/drivers/i810/common.h 2004-09-29 16:04:13.974719718 +0200
@@ -173,7 +173,7 @@
#define BEGIN_LP_RING(n) \
unsigned int outring, ringmask; \
volatile unsigned char *virt; \
- unsigned int needed; \
+ int needed; \
if ((n) & 1) \
ErrorF("BEGIN_LP_RING called with odd argument: %d\n", n); \
if ((n) > 2 && (I810_DEBUG&DEBUG_ALWAYS_SYNC)) \
@@ -206,7 +206,7 @@
#define BEGIN_LP_RING(n) \
unsigned int outring, ringmask; \
volatile unsigned char *virt; \
- unsigned int needed; \
+ int needed; \
if ((n) & 1) \
ErrorF("BEGIN_LP_RING called with odd argument: %d\n", n); \
if ((n) > 2 && (I810_DEBUG&DEBUG_ALWAYS_SYNC)) \
diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i810.h programs/Xserver/hw/xfree86/drivers/i810/i810.h
--- programs/Xserver/hw/xfree86/drivers/i810_old/i810.h 2004-09-29 16:03:59.639814611 +0200
+++ programs/Xserver/hw/xfree86/drivers/i810/i810.h 2004-09-29 16:04:13.974719718 +0200
@@ -172,7 +172,7 @@
unsigned long OverlayPhysical;
unsigned long OverlayStart;
int colorKey;
- int surfaceAllocation[I810_TOTAL_SURFACES];
+ unsigned int surfaceAllocation[I810_TOTAL_SURFACES];
int numSurfaces;
DGAModePtr DGAModes;
@@ -295,9 +295,10 @@
extern void I810Sync(ScrnInfoPtr pScrn);
extern unsigned long I810LocalToPhysical(ScrnInfoPtr pScrn,
unsigned long local);
-extern int I810AllocLow(I810MemRange * result, I810MemRange * pool, int size);
+extern int I810AllocLow(I810MemRange * result, I810MemRange * pool,
+ int size);
extern int I810AllocHigh(I810MemRange * result, I810MemRange * pool,
- int size);
+ int size);
extern Bool I810AllocateFront(ScrnInfoPtr pScrn);
extern int I810AllocateGARTMemory(ScrnInfoPtr pScrn);
diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i810_accel.c programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c
--- programs/Xserver/hw/xfree86/drivers/i810_old/i810_accel.c 2004-09-29 16:03:59.612818556 +0200
+++ programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c 2004-09-29 16:04:13.975719572 +0200
@@ -259,7 +259,7 @@
#ifdef XF86DRI
/* VT switching tries to do this.
*/
- if (!pI810->LockHeld && pI810->directRenderingEnabled) {
+ if ((!pI810->LockHeld && pI810->directRenderingEnabled) || !pScrn->vtSema) {
return;
}
#endif
diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i810_dri.c programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c
--- programs/Xserver/hw/xfree86/drivers/i810_old/i810_dri.c 2004-09-29 16:03:59.671809935 +0200
+++ programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c 2004-09-29 16:04:13.977719280 +0200
@@ -290,7 +290,7 @@
unsigned long dcacheHandle;
int sysmem_size = 0;
int back_size = 0;
- int pitch_idx = 0;
+ unsigned int pitch_idx = 0;
int bufs;
int width = pScrn->displayWidth * pI810->cpp;
int i;
diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i810_driver.c programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
--- programs/Xserver/hw/xfree86/drivers/i810_old/i810_driver.c 2004-09-29 16:03:59.553827177 +0200
+++ programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c 2004-09-29 16:04:13.979718988 +0200
@@ -1124,14 +1124,6 @@
xf86SetOperatingState(resVgaIo, pI810->pEnt->index, ResUnusedOpr);
xf86SetOperatingState(resVgaMem, pI810->pEnt->index, ResDisableOpr);
- pI810->LpRing = xalloc(sizeof(I810RingBuffer));
- if (!pI810->LpRing) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Could not allocate lpring data structure.\n");
- I810FreeRec(pScrn);
- return FALSE;
- }
-
return TRUE;
}
@@ -1159,7 +1151,7 @@
I810MapMem(ScrnInfoPtr pScrn)
{
I810Ptr pI810 = I810PTR(pScrn);
- unsigned i;
+ long i;
for (i = 2; i < pI810->FbMapSize; i <<= 1) ;
pI810->FbMapSize = i;
@@ -2074,6 +2066,13 @@
pI810 = I810PTR(pScrn);
hwp = VGAHWPTR(pScrn);
+ pI810->LpRing = xcalloc(sizeof(I810RingBuffer),1);
+ if (!pI810->LpRing) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Could not allocate lpring data structure.\n");
+ return FALSE;
+ }
+
miClearVisualTypes();
/* Re-implemented Direct Color support, -jens */
diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i810_memory.c programs/Xserver/hw/xfree86/drivers/i810/i810_memory.c
--- programs/Xserver/hw/xfree86/drivers/i810_old/i810_memory.c 2004-09-29 16:03:59.659811689 +0200
+++ programs/Xserver/hw/xfree86/drivers/i810/i810_memory.c 2004-09-29 16:04:13.980718842 +0200
@@ -55,7 +55,7 @@
int
I810AllocLow(I810MemRange * result, I810MemRange * pool, int size)
{
- if (size > pool->Size)
+ if (size > (long)pool->Size)
return 0;
pool->Size -= size;
@@ -69,7 +69,7 @@
int
I810AllocHigh(I810MemRange * result, I810MemRange * pool, int size)
{
- if (size > pool->Size)
+ if (size > (long)pool->Size)
return 0;
pool->Size -= size;
diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i810_reg.h programs/Xserver/hw/xfree86/drivers/i810/i810_reg.h
--- programs/Xserver/hw/xfree86/drivers/i810_old/i810_reg.h 2004-09-29 16:03:59.736800438 +0200
+++ programs/Xserver/hw/xfree86/drivers/i810/i810_reg.h 2004-09-29 16:04:13.981718696 +0200
@@ -459,11 +459,11 @@
#define I830_HEAD_MASK 0x001FFFFC
#define RING_START 0x08
-#define START_ADDR 0x00FFFFF8
+#define START_ADDR 0x03FFFFF8
#define I830_RING_START_MASK 0xFFFFF000
#define RING_LEN 0x0C
-#define RING_NR_PAGES 0x000FF000
+#define RING_NR_PAGES 0x001FF000
#define I830_RING_NR_PAGES 0x001FF000
#define RING_REPORT_MASK 0x00000006
#define RING_REPORT_64K 0x00000002
diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i830.h programs/Xserver/hw/xfree86/drivers/i810/i830.h
--- programs/Xserver/hw/xfree86/drivers/i810_old/i830.h 2004-09-29 16:03:59.645813735 +0200
+++ programs/Xserver/hw/xfree86/drivers/i810/i830.h 2004-09-29 16:04:13.982718550 +0200
@@ -180,17 +180,17 @@
int CacheLines;
/* These are set in PreInit and never changed. */
- unsigned long FbMapSize;
- unsigned long TotalVideoRam;
+ long FbMapSize;
+ long TotalVideoRam;
I830MemRange StolenMemory; /* pre-allocated memory */
- unsigned long BIOSMemorySize; /* min stolen pool size */
+ long BIOSMemorySize; /* min stolen pool size */
int BIOSMemSizeLoc;
/* These change according to what has been allocated. */
long FreeMemory;
I830MemRange MemoryAperture;
I830MemPool StolenPool;
- unsigned long allocatedMemory;
+ long allocatedMemory;
/* Regions allocated either from the above pools, or from agpgart. */
/* for single and dual head configurations */
@@ -348,7 +348,7 @@
int xoffset;
int yoffset;
- int SaveGeneration;
+ unsigned int SaveGeneration;
Bool vbeRestoreWorkaround;
Bool displayInfo;
Bool devicePresence;
@@ -415,7 +415,7 @@
extern Bool I830BindGARTMemory(ScrnInfoPtr pScrn);
extern Bool I830UnbindGARTMemory(ScrnInfoPtr pScrn);
extern unsigned long I830AllocVidMem(ScrnInfoPtr pScrn, I830MemRange *result,
- I830MemPool *pool, unsigned long size,
+ I830MemPool *pool, long size,
unsigned long alignment, int flags);
extern void I830PrintAllRegisters(I830RegPtr i830Reg);
diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i830_driver.c programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c
--- programs/Xserver/hw/xfree86/drivers/i810_old/i830_driver.c 2004-09-29 16:03:59.646813588 +0200
+++ programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c 2004-09-29 16:04:13.986717965 +0200
@@ -1028,7 +1028,7 @@
I830MapMem(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
- unsigned i;
+ long i;
for (i = 2; i < pI830->FbMapSize; i <<= 1) ;
pI830->FbMapSize = i;
@@ -2909,7 +2909,7 @@
OUTREG(LP_RING + RING_TAIL, 0);
OUTREG(LP_RING + RING_HEAD, 0);
- if ((pI830->LpRing->mem.Start & I830_RING_START_MASK) !=
+ if ((long)(pI830->LpRing->mem.Start & I830_RING_START_MASK) !=
pI830->LpRing->mem.Start) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"I830SetRingRegs: Ring buffer start (%lx) violates its "
@@ -3452,7 +3452,7 @@
I830Ptr pI8301 = I830PTR(pI830->entityPrivate->pScrn_1);
temp = INREG(stridereg);
- if (temp / pI8301->cpp != pI830->entityPrivate->pScrn_1->displayWidth) {
+ if (temp / pI8301->cpp != (CARD32)(pI830->entityPrivate->pScrn_1->displayWidth)) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(pI830->pipe),
(int)(temp / pI8301->cpp), pI830->entityPrivate->pScrn_1->displayWidth);
@@ -3470,7 +3470,7 @@
sizereg = pI830->pipe ? DSPASIZE : DSPBSIZE;
temp = INREG(stridereg);
- if (temp / pI8302->cpp != pI830->entityPrivate->pScrn_2->displayWidth) {
+ if (temp / pI8302->cpp != (CARD32)(pI830->entityPrivate->pScrn_2->displayWidth)) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(!pI830->pipe),
(int)(temp / pI8302->cpp), pI830->entityPrivate->pScrn_2->displayWidth);
@@ -3489,7 +3489,7 @@
I830Ptr pI8302 = I830PTR(pI830->entityPrivate->pScrn_2);
temp = INREG(stridereg);
- if (temp / pI8301->cpp != pI830->entityPrivate->pScrn_1->displayWidth) {
+ if (temp / pI8301->cpp != (CARD32)(pI830->entityPrivate->pScrn_1->displayWidth)) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(pI830->pipe),
(int)(temp / pI8301->cpp), pI830->entityPrivate->pScrn_1->displayWidth);
@@ -3505,7 +3505,7 @@
sizereg = !pI830->pipe ? DSPASIZE : DSPBSIZE;
temp = INREG(stridereg);
- if (temp / pI8302->cpp != pI830->entityPrivate->pScrn_2->displayWidth) {
+ if (temp / pI8302->cpp != ((CARD32)pI830->entityPrivate->pScrn_2->displayWidth)) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(!pI830->pipe),
(int)(temp / pI8302->cpp), pI830->entityPrivate->pScrn_2->displayWidth);
@@ -3526,7 +3526,7 @@
continue;
temp = INREG(stridereg);
- if (temp / pI830->cpp != pScrn->displayWidth) {
+ if (temp / pI830->cpp != (CARD32)pScrn->displayWidth) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(i),
(int)(temp / pI830->cpp), pScrn->displayWidth);
@@ -4527,7 +4527,8 @@
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
I830Ptr pI830 = I830PTR(pScrn);
Bool on = xf86IsUnblank(mode);
- CARD32 temp, ctrl, base, i;
+ CARD32 temp, ctrl, base;
+ int i;
DPRINTF(PFX, "I830BIOSSaveScreen: %d, on is %s\n", mode, BOOLTOSTRING(on));
Only in programs/Xserver/hw/xfree86/drivers/i810: i830_driver.c.orig
diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i830_memory.c programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c
--- programs/Xserver/hw/xfree86/drivers/i810_old/i830_memory.c 2004-09-29 16:03:59.547828054 +0200
+++ programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c 2004-09-29 16:04:13.988717673 +0200
@@ -63,10 +63,10 @@
*/
static unsigned long
AllocFromPool(ScrnInfoPtr pScrn, I830MemRange *result, I830MemPool *pool,
- unsigned long size, unsigned long alignment, int flags)
+ long size, unsigned long alignment, int flags)
{
I830Ptr pI830 = I830PTR(pScrn);
- unsigned long needed, start, end;
+ long needed, start, end;
Bool dryrun = ((flags & ALLOCATE_DRY_RUN) != 0);
if (!result || !pool || !size)
@@ -94,7 +94,7 @@
}
}
if (needed > pool->Free.Size) {
- unsigned long extra;
+ long extra;
/* See if the pool can be grown. */
if (pI830->StolenOnly && !dryrun)
return 0;
@@ -107,7 +107,7 @@
return 0;
}
- if (!dryrun && (extra > pI830->MemoryAperture.Size))
+ if (!dryrun && ((long)extra > pI830->MemoryAperture.Size))
return 0;
pool->Free.Size += extra;
@@ -136,7 +136,7 @@
}
static unsigned long
-AllocFromAGP(ScrnInfoPtr pScrn, I830MemRange *result, unsigned long size,
+AllocFromAGP(ScrnInfoPtr pScrn, I830MemRange *result, long size,
unsigned long alignment, int flags)
{
I830Ptr pI830 = I830PTR(pScrn);
@@ -212,7 +212,7 @@
unsigned long
I830AllocVidMem(ScrnInfoPtr pScrn, I830MemRange *result, I830MemPool *pool,
- unsigned long size, unsigned long alignment, int flags)
+ long size, unsigned long alignment, int flags)
{
I830Ptr pI830 = I830PTR(pScrn);
Bool dryrun = ((flags & ALLOCATE_DRY_RUN) != 0);
@@ -392,7 +392,7 @@
I830Allocate2DMemory(ScrnInfoPtr pScrn, const int flags)
{
I830Ptr pI830 = I830PTR(pScrn);
- unsigned long size, alloced;
+ long size, alloced;
Bool dryrun = ((flags & ALLOCATE_DRY_RUN) != 0);
int verbosity = dryrun ? 4 : 1;
const char *s = dryrun ? "[dryrun] " : "";
@@ -610,9 +610,9 @@
return FALSE;
}
} else {
- unsigned long lineSize;
- unsigned long extra = 0;
- unsigned long maxFb = 0;
+ long lineSize;
+ long extra = 0;
+ long maxFb = 0;
/*
* XXX Need to "free" up any 3D allocations if the DRI ended up
@@ -857,7 +857,7 @@
I830GetExcessMemoryAllocations(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
- unsigned long allocated;
+ long allocated;
allocated = pI830->StolenPool.Total.Size + pI830->allocatedMemory;
if (allocated > pI830->TotalVideoRam)
@@ -1367,7 +1367,7 @@
I830Ptr pI830 = I830PTR(pScrn);
int pitch, ntiles, i;
static int nextTile = 0;
- static int tileGeneration = -1;
+ static unsigned int tileGeneration = -1;
#if 0
/* Hack to "improve" the alignment of the front buffer.
-------------- next part --------------
Index: programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v
retrieving revision 1.10
diff -u -p -r1.10 i810_driver.c
--- programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c 17 Sep 2004 03:04:51 -0000 1.10
+++ programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c 29 Sep 2004 15:44:35 -0000
@@ -903,12 +903,15 @@ I810PreInit(ScrnInfoPtr pScrn, int flags
* size in the XF86Config, use that amount instead.
*
* Changed to 8 Meg so we can have acceleration by default (Mark).
+ * 16 MB is not enough for 3D in 1600x1200 (Matthias)
*/
mem = I810CheckAvailableMemory(pScrn);
- if (pI810->directRenderingDisabled || mem < 134217728) /* < 128 MB */
+ if (pI810->directRenderingDisabled || mem < 131072) /* < 128 MB */
pScrn->videoRam = 8192;
- else
+ else if (pI810->directRenderingDisabled || mem < 196608) /* < 192 MB */
pScrn->videoRam = 16384;
+ else
+ pScrn->videoRam = 24576;
from = X_DEFAULT;
if (pI810->pEnt->device->videoRam) {
-------------- next part --------------
Index: programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v
retrieving revision 1.10
diff -u -p -r1.10 i810_driver.c
--- programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c 17 Sep 2004 03:04:51 -0000 1.10
+++ programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c 24 Sep 2004 16:30:54 -0000
@@ -2504,9 +2504,6 @@ I810CloseScreen(int scrnIndex, ScreenPtr
*/
xf86GARTCloseScreen(scrnIndex);
- xfree(pI810->LpRing);
- pI810->LpRing = NULL;
-
pScrn->vtSema = FALSE;
pScreen->CloseScreen = pI810->CloseScreen;
return (*pScreen->CloseScreen) (scrnIndex, pScreen);
More information about the xorg
mailing list