diff options
author | Keith Packard <keithp@keithp.com> | 2008-07-31 01:48:07 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2008-08-11 20:13:38 -0400 |
commit | a8c84df9f71e4a7b14bdd41687a70d366c087eef (patch) | |
tree | fc11f372de1543c6816d783ee8a852fcecf434d7 /include/linux/agp_backend.h | |
parent | e3cf69511a2c5369c58f6fd6a065de152c3d4b22 (diff) |
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 'include/linux/agp_backend.h')
-rw-r--r-- | include/linux/agp_backend.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h index 972b12bcfb36..2b8df8b420fd 100644 --- a/include/linux/agp_backend.h +++ b/include/linux/agp_backend.h | |||
@@ -30,6 +30,8 @@ | |||
30 | #ifndef _AGP_BACKEND_H | 30 | #ifndef _AGP_BACKEND_H |
31 | #define _AGP_BACKEND_H 1 | 31 | #define _AGP_BACKEND_H 1 |
32 | 32 | ||
33 | #include <linux/list.h> | ||
34 | |||
33 | enum chipset_type { | 35 | enum chipset_type { |
34 | NOT_SUPPORTED, | 36 | NOT_SUPPORTED, |
35 | SUPPORTED, | 37 | SUPPORTED, |
@@ -78,6 +80,8 @@ struct agp_memory { | |||
78 | bool is_bound; | 80 | bool is_bound; |
79 | bool is_flushed; | 81 | bool is_flushed; |
80 | bool vmalloc_flag; | 82 | bool vmalloc_flag; |
83 | /* list of agp_memory mapped to the aperture */ | ||
84 | struct list_head mapped_list; | ||
81 | }; | 85 | }; |
82 | 86 | ||
83 | #define AGP_NORMAL_MEMORY 0 | 87 | #define AGP_NORMAL_MEMORY 0 |
@@ -96,6 +100,7 @@ extern struct agp_memory *agp_allocate_memory(struct agp_bridge_data *, size_t, | |||
96 | extern int agp_copy_info(struct agp_bridge_data *, struct agp_kern_info *); | 100 | extern int agp_copy_info(struct agp_bridge_data *, struct agp_kern_info *); |
97 | extern int agp_bind_memory(struct agp_memory *, off_t); | 101 | extern int agp_bind_memory(struct agp_memory *, off_t); |
98 | extern int agp_unbind_memory(struct agp_memory *); | 102 | extern int agp_unbind_memory(struct agp_memory *); |
103 | extern int agp_rebind_memory(void); | ||
99 | extern void agp_enable(struct agp_bridge_data *, u32); | 104 | extern void agp_enable(struct agp_bridge_data *, u32); |
100 | extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *); | 105 | extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *); |
101 | extern void agp_backend_release(struct agp_bridge_data *); | 106 | extern void agp_backend_release(struct agp_bridge_data *); |