From bb1eac0b6b0d2ab02bd7b47f3c2e4b3f40e7486f Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Sun, 17 Sep 2006 17:30:08 -0400 Subject: re-order SavageMapMem() so that ram detection works again. --- src/savage_driver.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/savage_driver.c b/src/savage_driver.c index a1a1674..20f1680 100644 --- a/src/savage_driver.c +++ b/src/savage_driver.c @@ -1671,6 +1671,13 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) /* maybe throw in some more sanity checks here */ + if (!SavageMapMem(pScrn)) { + SavageFreeRec(pScrn); + vbeFree(psav->pVbe); + psav->pVbe = NULL; + return FALSE; + } + vgaCRIndex = psav->vgaIOBase + 4; vgaCRReg = psav->vgaIOBase + 5; @@ -1857,6 +1864,9 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) pScrn->videoRam); } + pScrn->fbOffset = (psav->IsSecondary) + ? pScrn->videoRam * 1024 : 0; + /* reset graphics engine to avoid memory corruption */ VGAOUT8(vgaCRIndex, 0x66); cr66 = VGAIN8(vgaCRReg); @@ -1867,13 +1877,6 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) VGAOUT8(vgaCRReg, cr66 & ~0x02); /* clear reset flag */ usleep(10000); - if (!SavageMapMem(pScrn)) { - SavageFreeRec(pScrn); - vbeFree(psav->pVbe); - psav->pVbe = NULL; - return FALSE; - } - /* Set status word positions based on chip type. */ SavageInitStatus(pScrn); @@ -2924,9 +2927,6 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn) psav->ApertureMap += 0x1000000; } - pScrn->fbOffset = (psav->IsSecondary) - ? pScrn->videoRam * 1024 : 0; - pScrn->memPhysBase = psav->PciInfo->memBase[0]; return TRUE; -- cgit v1.2.3 From baa74b10d7a1c304dba2d658e4d1336b7ee7e70e Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 18 Sep 2006 22:30:13 -0400 Subject: fix DRI locking in savage driver. Based on ajax's similar patch. Thanks to ajax and tilman for locking advice and Pascal Sclafer for tracking this down. Fixes bug 6357. --- src/savage_dri.c | 10 ++++++++-- src/savage_driver.h | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/savage_dri.c b/src/savage_dri.c index b55573e..cefe1a7 100644 --- a/src/savage_dri.c +++ b/src/savage_dri.c @@ -338,7 +338,9 @@ static void SAVAGEWakeupHandler( int screenNum, pointer wakeupData, ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; SavagePtr psav = SAVPTR(pScrn); - DRILock(pScreen, 0); + psav->pDRIInfo->wrap.WakeupHandler = psav->coreWakeupHandler; + (*psav->pDRIInfo->wrap.WakeupHandler) (screenNum, wakeupData, result, pReadmask); + psav->pDRIInfo->wrap.WakeupHandler = SAVAGEWakeupHandler; psav->LockHeld = 1; if (psav->ShadowStatus) { /* fetch the global shadow counter */ @@ -376,7 +378,9 @@ static void SAVAGEBlockHandler( int screenNum, pointer blockData, psav->ShadowVirtual[1023] = globalShadowCounter; } psav->LockHeld = 0; - DRIUnlock(pScreen); + psav->pDRIInfo->wrap.BlockHandler = psav->coreBlockHandler; + (*psav->pDRIInfo->wrap.BlockHandler) (screenNum, blockData, pTimeout, pReadmask); + psav->pDRIInfo->wrap.BlockHandler = SAVAGEBlockHandler; } void SAVAGESelectBuffer( ScrnInfoPtr pScrn, int which ) @@ -888,7 +892,9 @@ Bool SAVAGEDRIScreenInit( ScreenPtr pScreen ) pDRIInfo->ddxDrawableTableEntry = SAVAGE_MAX_DRAWABLES; /* override default DRI block and wakeup handler */ + psav->coreBlockHandler = pDRIInfo->wrap.BlockHandler; pDRIInfo->wrap.BlockHandler = SAVAGEBlockHandler; + psav->coreWakeupHandler = pDRIInfo->wrap.WakeupHandler; pDRIInfo->wrap.WakeupHandler = SAVAGEWakeupHandler; pDRIInfo->wrap.ValidateTree = NULL; diff --git a/src/savage_driver.h b/src/savage_driver.h index f2193c3..f963fd7 100644 --- a/src/savage_driver.h +++ b/src/savage_driver.h @@ -444,7 +444,8 @@ typedef struct _Savage { __GLXvisualConfig* pVisualConfigs; SAVAGEConfigPrivPtr pVisualConfigsPriv; SAVAGEDRIServerPrivatePtr DRIServerInfo; - + ScreenWakeupHandlerProcPtr coreWakeupHandler; + ScreenBlockHandlerProcPtr coreBlockHandler; #if 0 Bool haveQuiescense; -- cgit v1.2.3 From a94abe5a59cf526ce0699d8356d239e1984d0907 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Tue, 19 Sep 2006 00:09:01 -0400 Subject: minor exa updates --- src/savage_dri.c | 10 ++++++++-- src/savage_exa.c | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/savage_dri.c b/src/savage_dri.c index cefe1a7..6f79d94 100644 --- a/src/savage_dri.c +++ b/src/savage_dri.c @@ -352,7 +352,10 @@ static void SAVAGEWakeupHandler( int screenNum, pointer wakeupData, #endif psav->ShadowCounter = psav->ShadowVirtual[1023] & 0xffff; } - psav->AccelInfoRec->NeedToSync = TRUE; + if (psav->useEXA) + exaMarkSync(pScreen); + else + psav->AccelInfoRec->NeedToSync = TRUE; /* FK: this flag doesn't seem to be used. */ } @@ -1535,7 +1538,10 @@ SAVAGEDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, } BCI_SEND(0xc0020000); /* wait for 2D idle */ - psav->AccelInfoRec->NeedToSync = TRUE; + if (psav->useEXA) + exaMarkSync(pScreen); + else + psav->AccelInfoRec->NeedToSync = TRUE; } static void diff --git a/src/savage_exa.c b/src/savage_exa.c index 942fe86..8e6da38 100644 --- a/src/savage_exa.c +++ b/src/savage_exa.c @@ -431,13 +431,14 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int /*ErrorF("in UTS\n");*/ - psav->WaitQueue(psav, 5); + psav->WaitQueue(psav, 6); BCI_SEND(cmd); /* dst */ BCI_SEND(psav->sbd_offset); BCI_SEND(psav->sbd_high); + BCI_SEND(BCI_CLIP_LR(x, x+w-1)); BCI_SEND(BCI_X_Y(x, y)); BCI_SEND(BCI_W_H(w, h)); -- cgit v1.2.3 From e361a9523394a2f0558f7d2648bf6a43ebe31f2e Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Thu, 28 Sep 2006 22:02:29 -0400 Subject: bump to 2.1.2 for new release --- src/savage_driver.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/savage_driver.h b/src/savage_driver.h index f963fd7..cec8f61 100644 --- a/src/savage_driver.h +++ b/src/savage_driver.h @@ -178,10 +178,10 @@ typedef struct #define SAVAGE_TV_ON 4 #define SAVAGE_DRIVER_NAME "savage" -#define SAVAGE_DRIVER_VERSION "2.1.1" +#define SAVAGE_DRIVER_VERSION "2.1.2" #define SAVAGE_VERSION_MAJOR 2 #define SAVAGE_VERSION_MINOR 1 -#define SAVAGE_PATCHLEVEL 1 +#define SAVAGE_PATCHLEVEL 2 #define SAVAGE_VERSION ((SAVAGE_VERSION_MAJOR << 24) | \ (SAVAGE_VERSION_MINOR << 16) | \ SAVAGE_PATCHLEVEL) -- cgit v1.2.3