drm/nvc0: fix thinko in instmem suspend/resume
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
20d66daf0a
commit
b515f3a2d8
1 changed files with 7 additions and 4 deletions
|
@ -142,14 +142,16 @@ int
|
||||||
nvc0_instmem_suspend(struct drm_device *dev)
|
nvc0_instmem_suspend(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||||
|
u32 *buf;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
dev_priv->susres.ramin_copy = vmalloc(65536);
|
dev_priv->susres.ramin_copy = vmalloc(65536);
|
||||||
if (!dev_priv->susres.ramin_copy)
|
if (!dev_priv->susres.ramin_copy)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
buf = dev_priv->susres.ramin_copy;
|
||||||
|
|
||||||
for (i = 0x700000; i < 0x710000; i += 4)
|
for (i = 0; i < 65536; i += 4)
|
||||||
dev_priv->susres.ramin_copy[i/4] = nv_rd32(dev, i);
|
buf[i/4] = nv_rd32(dev, NV04_PRAMIN + i);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,14 +159,15 @@ void
|
||||||
nvc0_instmem_resume(struct drm_device *dev)
|
nvc0_instmem_resume(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||||
|
u32 *buf = dev_priv->susres.ramin_copy;
|
||||||
u64 chan;
|
u64 chan;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
chan = dev_priv->vram_size - dev_priv->ramin_rsvd_vram;
|
chan = dev_priv->vram_size - dev_priv->ramin_rsvd_vram;
|
||||||
nv_wr32(dev, 0x001700, chan >> 16);
|
nv_wr32(dev, 0x001700, chan >> 16);
|
||||||
|
|
||||||
for (i = 0x700000; i < 0x710000; i += 4)
|
for (i = 0; i < 65536; i += 4)
|
||||||
nv_wr32(dev, i, dev_priv->susres.ramin_copy[i/4]);
|
nv_wr32(dev, NV04_PRAMIN + i, buf[i/4]);
|
||||||
vfree(dev_priv->susres.ramin_copy);
|
vfree(dev_priv->susres.ramin_copy);
|
||||||
dev_priv->susres.ramin_copy = NULL;
|
dev_priv->susres.ramin_copy = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue