Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329643
b: refs/heads/master
c: b10f20d
h: refs/heads/master
i:
  329641: acb9b32
  329639: 2972a5c
v: v3
  • Loading branch information
Ben Skeggs committed Oct 3, 2012
1 parent f9928ed commit d93f5d8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5999933f4de7de7bcaae4be87667b0cff57d6e45
refs/heads/master: b10f20d590aa040e4028c04a70a27b9ad6650ba8
27 changes: 7 additions & 20 deletions trunk/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,29 +151,16 @@ nvc0_grctx_fini(struct nvc0_grctx *info)
struct nvc0_graph_priv *priv = info->priv;
int i;

if (priv->firmware) {
nv_wr32(priv, 0x409840, 0x00000003);
nv_wr32(priv, 0x409500, 0x80000000 | info->chan->addr >> 12);
nv_wr32(priv, 0x409504, 0x00000009);
if (!nv_wait(priv, 0x409800, 0x00000001, 0x00000000)) {
nv_error(priv, "unload_ctx timeout\n");
return -EBUSY;
}

goto save;
}

/* HUB_FUC(CTX_SAVE) */
nv_wr32(priv, 0x409840, 0x80000000);
nv_wr32(priv, 0x409500, 0x80000000 | info->chan->addr >> 12);
nv_wr32(priv, 0x409504, 0x00000002);
if (!nv_wait(priv, 0x409800, 0x80000000, 0x80000000)) {
nv_error(priv, "HUB_CTX_SAVE timeout\n");
nvc0_graph_ctxctl_debug(priv);
/* trigger a context unload by unsetting the "next channel valid" bit
* and faking a context switch interrupt
*/
nv_mask(priv, 0x409b04, 0x80000000, 0x00000000);
nv_wr32(priv, 0x409000, 0x00000100);
if (!nv_wait(priv, 0x409b00, 0x80000000, 0x00000000)) {
nv_error(priv, "grctx template channel unload timeout\n");
return -EBUSY;
}

save:
priv->data = kmalloc(priv->size, GFP_KERNEL);
if (priv->data) {
for (i = 0; i < priv->size; i += 4)
Expand Down
8 changes: 1 addition & 7 deletions trunk/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,6 @@ nvc0_graph_init_ctxctl(struct nvc0_graph_priv *priv)
nv_error(priv, "failed to construct context\n");
return ret;
}

return 1;
}

return 0;
Expand All @@ -720,7 +718,6 @@ nvc0_graph_init(struct nouveau_object *object)
struct nvc0_graph_priv *priv = (void *)object;
int ret;

reset:
ret = nouveau_graph_init(&priv->base);
if (ret)
return ret;
Expand Down Expand Up @@ -748,11 +745,8 @@ nvc0_graph_init(struct nouveau_object *object)
nv_wr32(priv, 0x400054, 0x34ce3464);

ret = nvc0_graph_init_ctxctl(priv);
if (ret) {
if (ret == 1)
goto reset;
if (ret)
return ret;
}

return 0;
}
Expand Down
8 changes: 1 addition & 7 deletions trunk/drivers/gpu/drm/nouveau/core/engine/graph/nve0.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,6 @@ nve0_graph_init_ctxctl(struct nvc0_graph_priv *priv)
nv_error(priv, "failed to construct context\n");
return ret;
}

return 1;
}

return 0;
Expand All @@ -470,7 +468,6 @@ nve0_graph_init(struct nouveau_object *object)
struct nvc0_graph_priv *priv = (void *)object;
int ret;

reset:
ret = nouveau_graph_init(&priv->base);
if (ret)
return ret;
Expand All @@ -496,11 +493,8 @@ nve0_graph_init(struct nouveau_object *object)
nv_wr32(priv, 0x400054, 0x34ce3464);

ret = nve0_graph_init_ctxctl(priv);
if (ret) {
if (ret == 1)
goto reset;
if (ret)
return ret;
}

return 0;
}
Expand Down

0 comments on commit d93f5d8

Please sign in to comment.