summaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/backend.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-07-31 07:48:07 +0200
committerDave Airlie <airlied@redhat.com>2008-08-12 02:13:38 +0200
commita8c84df9f71e4a7b14bdd41687a70d366c087eef (patch)
treefc11f372de1543c6816d783ee8a852fcecf434d7 /drivers/char/agp/backend.c
parentagp: use dev_printk when possible (diff)
downloadlinux-a8c84df9f71e4a7b14bdd41687a70d366c087eef.tar.xz
linux-a8c84df9f71e4a7b14bdd41687a70d366c087eef.zip
intel/agp: rewrite GTT on resume
On my Intel chipset (965GM), the GTT is entirely erased across suspend/resume. This patch simply re-plays the current mapping at resume time to restore the table.=20 I noticed this once I started relying on persistent GTT mappings across VT switch in our GEM work -- the old X server and DRM code carefully unbind all memory from the GTT on VT switch, but GEM does not bother. I placed the list management and rewrite code in the generic layer on the assumption that it will be needed on other hardware, but I did not add the rewrite call to anything other than the Intel resume function. Keep a list of current GATT mappings. At resume time, rewrite them into the GATT. This is needed on Intel (at least) as the entire GATT is cleared across suspend/resume. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Keith Packard <keithp@keithp.com> Cc: Dave Jones <davej@codemonkey.org.uk> Cc: Andi Kleen <andi@firstfloor.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/char/agp/backend.c')
-rw-r--r--drivers/char/agp/backend.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c
index 9626d3bda096..3a3cc03d401c 100644
--- a/drivers/char/agp/backend.c
+++ b/drivers/char/agp/backend.c
@@ -185,6 +185,8 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
rc = -EINVAL;
goto err_out;
}
+ INIT_LIST_HEAD(&bridge->mapped_list);
+ spin_lock_init(&bridge->mapped_lock);
return 0;