aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-08-04 21:29:10 -0400
committerBen Skeggs <bskeggs@redhat.com>2012-10-02 23:13:00 -0400
commitb10f20d590aa040e4028c04a70a27b9ad6650ba8 (patch)
treedadda877d9850bcf67a17057e4c7ac5b02e2db2a
parent5999933f4de7de7bcaae4be87667b0cff57d6e45 (diff)
drm/nvc0-/gr: remove reset-after-grctx-construction hack
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c27
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c8
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/nve0.c8
3 files changed, 9 insertions, 34 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c
index c12e7668dbfe..0b7951a85943 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c
@@ -151,29 +151,16 @@ nvc0_grctx_fini(struct nvc0_grctx *info)
151 struct nvc0_graph_priv *priv = info->priv; 151 struct nvc0_graph_priv *priv = info->priv;
152 int i; 152 int i;
153 153
154 if (priv->firmware) { 154 /* trigger a context unload by unsetting the "next channel valid" bit
155 nv_wr32(priv, 0x409840, 0x00000003); 155 * and faking a context switch interrupt
156 nv_wr32(priv, 0x409500, 0x80000000 | info->chan->addr >> 12); 156 */
157 nv_wr32(priv, 0x409504, 0x00000009); 157 nv_mask(priv, 0x409b04, 0x80000000, 0x00000000);
158 if (!nv_wait(priv, 0x409800, 0x00000001, 0x00000000)) { 158 nv_wr32(priv, 0x409000, 0x00000100);
159 nv_error(priv, "unload_ctx timeout\n"); 159 if (!nv_wait(priv, 0x409b00, 0x80000000, 0x00000000)) {
160 return -EBUSY; 160 nv_error(priv, "grctx template channel unload timeout\n");
161 }
162
163 goto save;
164 }
165
166 /* HUB_FUC(CTX_SAVE) */
167 nv_wr32(priv, 0x409840, 0x80000000);
168 nv_wr32(priv, 0x409500, 0x80000000 | info->chan->addr >> 12);
169 nv_wr32(priv, 0x409504, 0x00000002);
170 if (!nv_wait(priv, 0x409800, 0x80000000, 0x80000000)) {
171 nv_error(priv, "HUB_CTX_SAVE timeout\n");
172 nvc0_graph_ctxctl_debug(priv);
173 return -EBUSY; 161 return -EBUSY;
174 } 162 }
175 163
176save:
177 priv->data = kmalloc(priv->size, GFP_KERNEL); 164 priv->data = kmalloc(priv->size, GFP_KERNEL);
178 if (priv->data) { 165 if (priv->data) {
179 for (i = 0; i < priv->size; i += 4) 166 for (i = 0; i < priv->size; i += 4)
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
index db8aefc3cf3e..e2f1bea53540 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
@@ -707,8 +707,6 @@ nvc0_graph_init_ctxctl(struct nvc0_graph_priv *priv)
707 nv_error(priv, "failed to construct context\n"); 707 nv_error(priv, "failed to construct context\n");
708 return ret; 708 return ret;
709 } 709 }
710
711 return 1;
712 } 710 }
713 711
714 return 0; 712 return 0;
@@ -720,7 +718,6 @@ nvc0_graph_init(struct nouveau_object *object)
720 struct nvc0_graph_priv *priv = (void *)object; 718 struct nvc0_graph_priv *priv = (void *)object;
721 int ret; 719 int ret;
722 720
723reset:
724 ret = nouveau_graph_init(&priv->base); 721 ret = nouveau_graph_init(&priv->base);
725 if (ret) 722 if (ret)
726 return ret; 723 return ret;
@@ -748,11 +745,8 @@ reset:
748 nv_wr32(priv, 0x400054, 0x34ce3464); 745 nv_wr32(priv, 0x400054, 0x34ce3464);
749 746
750 ret = nvc0_graph_init_ctxctl(priv); 747 ret = nvc0_graph_init_ctxctl(priv);
751 if (ret) { 748 if (ret)
752 if (ret == 1)
753 goto reset;
754 return ret; 749 return ret;
755 }
756 750
757 return 0; 751 return 0;
758} 752}
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nve0.c b/drivers/gpu/drm/nouveau/core/engine/graph/nve0.c
index c79748a6fa2b..7ef692b92e83 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/nve0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/nve0.c
@@ -457,8 +457,6 @@ nve0_graph_init_ctxctl(struct nvc0_graph_priv *priv)
457 nv_error(priv, "failed to construct context\n"); 457 nv_error(priv, "failed to construct context\n");
458 return ret; 458 return ret;
459 } 459 }
460
461 return 1;
462 } 460 }
463 461
464 return 0; 462 return 0;
@@ -470,7 +468,6 @@ nve0_graph_init(struct nouveau_object *object)
470 struct nvc0_graph_priv *priv = (void *)object; 468 struct nvc0_graph_priv *priv = (void *)object;
471 int ret; 469 int ret;
472 470
473reset:
474 ret = nouveau_graph_init(&priv->base); 471 ret = nouveau_graph_init(&priv->base);
475 if (ret) 472 if (ret)
476 return ret; 473 return ret;
@@ -496,11 +493,8 @@ reset:
496 nv_wr32(priv, 0x400054, 0x34ce3464); 493 nv_wr32(priv, 0x400054, 0x34ce3464);
497 494
498 ret = nve0_graph_init_ctxctl(priv); 495 ret = nve0_graph_init_ctxctl(priv);
499 if (ret) { 496 if (ret)
500 if (ret == 1)
501 goto reset;
502 return ret; 497 return ret;
503 }
504 498
505 return 0; 499 return 0;
506} 500}