summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2006-04-21 00:44:58 +0000
committerDave Airlie <airlied@linux.ie>2006-04-21 00:44:58 +0000
commit12b10b21cb0bb904acc8d873dca98d10c4309416 (patch)
tree5959ced1ba0b70985ac23f3a486a376f690dd168 /src
parent99e2c65d3bd984bc87c05b2a2c1503ee32ff3bd5 (diff)
Add support for backing up the PCIE GART table on VT switch. This makes
suspend/resume work a lot better on PCIE cards.
Diffstat (limited to 'src')
-rw-r--r--src/radeon.h2
-rw-r--r--src/radeon_dri.c13
-rw-r--r--src/radeon_driver.c14
3 files changed, 27 insertions, 2 deletions
diff --git a/src/radeon.h b/src/radeon.h
index bdee01db..02098b6a 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -588,7 +588,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 1b67e9d6..7e5840cf 100644
--- a/src/radeon_dri.c
+++ b/src/radeon_dri.c
@@ -1763,6 +1763,11 @@ void RADEONDRICloseScreen(ScreenPtr pScreen)
info->pciMemHandle = 0;
}
+ if (info->pciGartBackup) {
+ xfree(info->pciGartBackup);
+ info->pciGartBackup = NULL;
+ }
+
/* De-allocate all DRI resources */
DRICloseScreen(pScreen);
@@ -2038,5 +2043,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 467cc0d5..3ee8d65b 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.92.2.13 2006/03/23 01:39:07 benh Exp $ */
+/* $XdotOrg: driver/xf86-video-ati/src/radeon_driver.c,v 1.92.2.14 2006/03/27 06:24:34 benh Exp $ */
/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
* VA Linux Systems Inc., Fremont, California.
@@ -8951,6 +8951,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);
@@ -8990,6 +8996,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