drm/nvc0-/gr: remove reset-after-grctx-construction hack
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
5999933f4d
commit
b10f20d590
@ -151,29 +151,16 @@ nvc0_grctx_fini(struct nvc0_grctx *info)
|
|||||||
struct nvc0_graph_priv *priv = info->priv;
|
struct nvc0_graph_priv *priv = info->priv;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (priv->firmware) {
|
/* trigger a context unload by unsetting the "next channel valid" bit
|
||||||
nv_wr32(priv, 0x409840, 0x00000003);
|
* and faking a context switch interrupt
|
||||||
nv_wr32(priv, 0x409500, 0x80000000 | info->chan->addr >> 12);
|
*/
|
||||||
nv_wr32(priv, 0x409504, 0x00000009);
|
nv_mask(priv, 0x409b04, 0x80000000, 0x00000000);
|
||||||
if (!nv_wait(priv, 0x409800, 0x00000001, 0x00000000)) {
|
nv_wr32(priv, 0x409000, 0x00000100);
|
||||||
nv_error(priv, "unload_ctx timeout\n");
|
if (!nv_wait(priv, 0x409b00, 0x80000000, 0x00000000)) {
|
||||||
return -EBUSY;
|
nv_error(priv, "grctx template channel unload timeout\n");
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
save:
|
|
||||||
priv->data = kmalloc(priv->size, GFP_KERNEL);
|
priv->data = kmalloc(priv->size, GFP_KERNEL);
|
||||||
if (priv->data) {
|
if (priv->data) {
|
||||||
for (i = 0; i < priv->size; i += 4)
|
for (i = 0; i < priv->size; i += 4)
|
||||||
|
@ -707,8 +707,6 @@ nvc0_graph_init_ctxctl(struct nvc0_graph_priv *priv)
|
|||||||
nv_error(priv, "failed to construct context\n");
|
nv_error(priv, "failed to construct context\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -720,7 +718,6 @@ nvc0_graph_init(struct nouveau_object *object)
|
|||||||
struct nvc0_graph_priv *priv = (void *)object;
|
struct nvc0_graph_priv *priv = (void *)object;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
reset:
|
|
||||||
ret = nouveau_graph_init(&priv->base);
|
ret = nouveau_graph_init(&priv->base);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
@ -748,11 +745,8 @@ reset:
|
|||||||
nv_wr32(priv, 0x400054, 0x34ce3464);
|
nv_wr32(priv, 0x400054, 0x34ce3464);
|
||||||
|
|
||||||
ret = nvc0_graph_init_ctxctl(priv);
|
ret = nvc0_graph_init_ctxctl(priv);
|
||||||
if (ret) {
|
if (ret)
|
||||||
if (ret == 1)
|
|
||||||
goto reset;
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -457,8 +457,6 @@ nve0_graph_init_ctxctl(struct nvc0_graph_priv *priv)
|
|||||||
nv_error(priv, "failed to construct context\n");
|
nv_error(priv, "failed to construct context\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -470,7 +468,6 @@ nve0_graph_init(struct nouveau_object *object)
|
|||||||
struct nvc0_graph_priv *priv = (void *)object;
|
struct nvc0_graph_priv *priv = (void *)object;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
reset:
|
|
||||||
ret = nouveau_graph_init(&priv->base);
|
ret = nouveau_graph_init(&priv->base);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
@ -496,11 +493,8 @@ reset:
|
|||||||
nv_wr32(priv, 0x400054, 0x34ce3464);
|
nv_wr32(priv, 0x400054, 0x34ce3464);
|
||||||
|
|
||||||
ret = nve0_graph_init_ctxctl(priv);
|
ret = nve0_graph_init_ctxctl(priv);
|
||||||
if (ret) {
|
if (ret)
|
||||||
if (ret == 1)
|
|
||||||
goto reset;
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user