summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2006-04-21 00:34:43 +0000
committerDave Airlie <airlied@linux.ie>2006-04-21 00:34:43 +0000
commitf1f057df9aaba42986d9e20afe6f609a90318333 (patch)
tree00c3abd8198b0ae0570f9f3025c354d51f6937ac
parent31396df3b0101571bb85a4a66b67f5a8b0c992a9 (diff)
Add support for backing up the PCIE GART table on VT switch. This makes
suspend/resume work a lot better on PCIE cards.
-rw-r--r--ChangeLog9
-rw-r--r--src/radeon.h2
-rw-r--r--src/radeon_dri.c13
-rw-r--r--src/radeon_driver.c14
4 files changed, 36 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1cc97d00..71caac08 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-04-21 Dave Airlie <airlied@linux.ie>
+
+ * src/radeon.h:
+ * src/radeon_dri.c: (RADEONDRICloseScreen),
+ (RADEONDRIAllocatePCIGARTTable):
+ * src/radeon_driver.c: (RADEONEnterVT), (RADEONLeaveVT):
+ Add support for backing up the PCIE GART table on VT switch.
+ This makes suspend/resume work a lot better on PCIE cards.
+
2006-04-07 Adam Jackson <ajax@freedesktop.org>
* configure.ac:
diff --git a/src/radeon.h b/src/radeon.h
index acf253c7..3735de35 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -587,7 +587,7 @@ typedef struct {
int pciGartSize;
CARD32 pciGartOffset;
-
+ void *pciGartBackup;
#ifdef USE_XAA
CARD32 frontPitchOffset;
CARD32 backPitchOffset;
diff --git a/src/radeon_dri.c b/src/radeon_dri.c
index 47b03bad..55eb2972 100644
--- a/src/radeon_dri.c
+++ b/src/radeon_dri.c
@@ -1765,6 +1765,11 @@ void RADEONDRICloseScreen(ScreenPtr pScreen)
info->pciMemHandle = 0;
}
+ if (info->pciGartBackup) {
+ xfree(info->pciGartBackup);
+ info->pciGartBackup = NULL;
+ }
+
/* De-allocate all DRI resources */
DRICloseScreen(pScreen);
@@ -2040,5 +2045,13 @@ void RADEONDRIAllocatePCIGARTTable(ScreenPtr pScreen)
return;
info->pciGartSize = RADEON_PCIGART_TABLE_SIZE;
+
+ /* allocate space to back up PCIEGART table */
+ info->pciGartBackup = xnfcalloc(1, info->pciGartSize);
+ if (info->pciGartBackup == NULL)
+ return;
+
info->pciGartOffset = (info->FbMapSize - info->FbSecureSize);
+
+
}
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 95b16644..5d173070 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -1,5 +1,5 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v 1.117 2004/02/19 22:38:12 tsi Exp $ */
-/* $XdotOrg: driver/xf86-video-ati/src/radeon_driver.c,v 1.109 2006-03-27 06:12:57 benh Exp $ */
+/* $XdotOrg: driver/xf86-video-ati/src/radeon_driver.c,v 1.110 2006/04/01 23:02:40 agd5f Exp $ */
/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
* VA Linux Systems Inc., Fremont, California.
@@ -9004,6 +9004,12 @@ _X_EXPORT Bool RADEONEnterVT(int scrnIndex, int flags)
RADEONRestoreSurfaces(pScrn, &info->ModeReg);
#ifdef XF86DRI
if (info->directRenderingEnabled) {
+ if (info->cardType == CARD_PCIE && info->pKernelDRMVersion->version_minor >= 19 && info->FbSecureSize)
+ {
+ /* we need to backup the PCIE GART TABLE from fb memory */
+ memcpy(info->FB + info->pciGartOffset, info->pciGartBackup, info->pciGartSize);
+ }
+
/* get the DRI back into shape after resume */
RADEONDRIResume(pScrn->pScreen);
RADEONAdjustMemMapRegisters(pScrn, &info->ModeReg);
@@ -9043,6 +9049,12 @@ _X_EXPORT void RADEONLeaveVT(int scrnIndex, int flags)
if (RADEONPTR(pScrn)->directRenderingInited) {
DRILock(pScrn->pScreen, 0);
RADEONCP_STOP(pScrn, info);
+
+ if (info->cardType == CARD_PCIE && info->pKernelDRMVersion->version_minor >= 19 && info->FbSecureSize)
+ {
+ /* we need to backup the PCIE GART TABLE from fb memory */
+ memcpy(info->pciGartBackup, (info->FB + info->pciGartOffset), info->pciGartSize);
+ }
}
#endif