Commit 0638df42 authored by Ben Skeggs's avatar Ben Skeggs

drm/nvc0/fifo: restore context table on resume

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 7a5c23de
...@@ -240,7 +240,6 @@ nvc0_fifo_load_context(struct nouveau_channel *chan) ...@@ -240,7 +240,6 @@ nvc0_fifo_load_context(struct nouveau_channel *chan)
int int
nvc0_fifo_unload_context(struct drm_device *dev) nvc0_fifo_unload_context(struct drm_device *dev)
{ {
struct drm_nouveau_private *dev_priv = dev->dev_private;
int i; int i;
for (i = 0; i < 128; i++) { for (i = 0; i < 128; i++) {
...@@ -325,6 +324,7 @@ nvc0_fifo_init(struct drm_device *dev) ...@@ -325,6 +324,7 @@ nvc0_fifo_init(struct drm_device *dev)
{ {
struct drm_nouveau_private *dev_priv = dev->dev_private; struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo; struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
struct nouveau_channel *chan;
struct nvc0_fifo_priv *priv; struct nvc0_fifo_priv *priv;
int ret, i; int ret, i;
...@@ -367,6 +367,19 @@ nvc0_fifo_init(struct drm_device *dev) ...@@ -367,6 +367,19 @@ nvc0_fifo_init(struct drm_device *dev)
nv_wr32(dev, 0x002a00, 0xffffffff); /* clears PFIFO.INTR bit 30 */ nv_wr32(dev, 0x002a00, 0xffffffff); /* clears PFIFO.INTR bit 30 */
nv_wr32(dev, 0x002100, 0xffffffff); nv_wr32(dev, 0x002100, 0xffffffff);
nv_wr32(dev, 0x002140, 0xbfffffff); nv_wr32(dev, 0x002140, 0xbfffffff);
/* restore PFIFO context table */
for (i = 0; i < 128; i++) {
chan = dev_priv->channels.ptr[i];
if (!chan || !chan->fifo_priv)
continue;
nv_wr32(dev, 0x003000 + (i * 8), 0xc0000000 |
(chan->ramin->vinst >> 12));
nv_wr32(dev, 0x003004 + (i * 8), 0x001f0001);
}
nvc0_fifo_playlist_update(dev);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment