summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 2d88ac53..7e0bd7ce 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -764,12 +764,15 @@ static int gr_gk20a_ctx_zcull_setup(struct gk20a *g, struct channel_gk20a *c)
764 va_hi = u64_hi32(ch_ctx->zcull_ctx.gpu_va); 764 va_hi = u64_hi32(ch_ctx->zcull_ctx.gpu_va);
765 va = ((va_lo >> 8) & 0x00FFFFFF) | ((va_hi << 24) & 0xFF000000); 765 va = ((va_lo >> 8) & 0x00FFFFFF) | ((va_hi << 24) & 0xFF000000);
766 766
767 c->g->ops.fifo.disable_channel(c); 767 ret = gk20a_disable_channel_tsg(g, c);
768 ret = c->g->ops.fifo.preempt_channel(c->g, c->hw_chid);
769 if (ret) { 768 if (ret) {
770 c->g->ops.fifo.enable_channel(c); 769 gk20a_err(dev_from_gk20a(g), "failed to disable channel/TSG\n");
771 gk20a_err(dev_from_gk20a(g), 770 goto clean_up;
772 "failed to disable gr engine activity\n"); 771 }
772 ret = gk20a_fifo_preempt(g, c);
773 if (ret) {
774 gk20a_enable_channel_tsg(g, c);
775 gk20a_err(dev_from_gk20a(g), "failed to preempt channel/TSG\n");
773 goto clean_up; 776 goto clean_up;
774 } 777 }
775 778
@@ -780,7 +783,7 @@ static int gr_gk20a_ctx_zcull_setup(struct gk20a *g, struct channel_gk20a *c)
780 gk20a_mem_wr(g, mem, 783 gk20a_mem_wr(g, mem,
781 ctxsw_prog_main_image_zcull_ptr_o(), va); 784 ctxsw_prog_main_image_zcull_ptr_o(), va);
782 785
783 c->g->ops.fifo.enable_channel(c); 786 gk20a_enable_channel_tsg(g, c);
784 787
785clean_up: 788clean_up:
786 gk20a_mem_end(g, mem); 789 gk20a_mem_end(g, mem);
@@ -1617,10 +1620,15 @@ int gr_gk20a_update_smpc_ctxsw_mode(struct gk20a *g,
1617 1620
1618 mem = &ch_ctx->gr_ctx->mem; 1621 mem = &ch_ctx->gr_ctx->mem;
1619 1622
1620 c->g->ops.fifo.disable_channel(c); 1623 ret = gk20a_disable_channel_tsg(g, c);
1621 ret = c->g->ops.fifo.preempt_channel(c->g, c->hw_chid);
1622 if (ret) { 1624 if (ret) {
1623 gk20a_err(dev_from_gk20a(g), "failed to preempt channel"); 1625 gk20a_err(dev_from_gk20a(g), "failed to disable channel/TSG\n");
1626 goto out;
1627 }
1628 ret = gk20a_fifo_preempt(g, c);
1629 if (ret) {
1630 gk20a_enable_channel_tsg(g, c);
1631 gk20a_err(dev_from_gk20a(g), "failed to preempt channel/TSG\n");
1624 goto out; 1632 goto out;
1625 } 1633 }
1626 1634
@@ -1646,7 +1654,7 @@ int gr_gk20a_update_smpc_ctxsw_mode(struct gk20a *g,
1646 gk20a_mem_end(g, mem); 1654 gk20a_mem_end(g, mem);
1647 1655
1648out: 1656out:
1649 c->g->ops.fifo.enable_channel(c); 1657 gk20a_enable_channel_tsg(g, c);
1650 return ret; 1658 return ret;
1651} 1659}
1652 1660