diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-08-04 08:48:34 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-08-05 18:35:54 -0400 |
commit | 147cad0936f3c59ec5678fe47319e44e3ea44d87 (patch) | |
tree | 1a974459f4a4a621538db49a6281a9069dc6c98c /drivers | |
parent | b715d64028ea90bcb67b3823ae1cc908a4ae0bc6 (diff) |
drm/nvc0: backup bar3 channel on suspend
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvc0_instmem.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvc0_instmem.c b/drivers/gpu/drm/nouveau/nvc0_instmem.c index e2a0bb84d91..e74bd454f63 100644 --- a/drivers/gpu/drm/nouveau/nvc0_instmem.c +++ b/drivers/gpu/drm/nouveau/nvc0_instmem.c | |||
@@ -141,12 +141,34 @@ nvc0_instmem_flush(struct drm_device *dev) | |||
141 | int | 141 | int |
142 | nvc0_instmem_suspend(struct drm_device *dev) | 142 | nvc0_instmem_suspend(struct drm_device *dev) |
143 | { | 143 | { |
144 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
145 | int i; | ||
146 | |||
147 | dev_priv->susres.ramin_copy = vmalloc(65536); | ||
148 | if (!dev_priv->susres.ramin_copy) | ||
149 | return -ENOMEM; | ||
150 | |||
151 | for (i = 0x700000; i < 0x710000; i += 4) | ||
152 | dev_priv->susres.ramin_copy[i/4] = nv_rd32(dev, i); | ||
144 | return 0; | 153 | return 0; |
145 | } | 154 | } |
146 | 155 | ||
147 | void | 156 | void |
148 | nvc0_instmem_resume(struct drm_device *dev) | 157 | nvc0_instmem_resume(struct drm_device *dev) |
149 | { | 158 | { |
159 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
160 | u64 chan; | ||
161 | int i; | ||
162 | |||
163 | chan = dev_priv->vram_size - dev_priv->ramin_rsvd_vram; | ||
164 | nv_wr32(dev, 0x001700, chan >> 16); | ||
165 | |||
166 | for (i = 0x700000; i < 0x710000; i += 4) | ||
167 | nv_wr32(dev, i, dev_priv->susres.ramin_copy[i/4]); | ||
168 | vfree(dev_priv->susres.ramin_copy); | ||
169 | dev_priv->susres.ramin_copy = NULL; | ||
170 | |||
171 | nv_wr32(dev, 0x001714, 0xc0000000 | (chan >> 12)); | ||
150 | } | 172 | } |
151 | 173 | ||
152 | int | 174 | int |