summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorArto Merilainen <amerilainen@nvidia.com>2014-07-31 08:11:45 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:02 -0400
commit447aab482a68be70cece649da88c656919d155d1 (patch)
tree364f8230fda4312aa68872670a64c4019491703d /drivers/gpu
parent9e3fc22ea77e5b484d7d05933c66875277a31c78 (diff)
gpu: nvgpu: cde: Re-use context
Currently cde reinitialises the context each time before submitting work to the channel. This was done to ensure that we are able to get clean context for the shader during development phase. However, as the shader has been tested to work w/o reinitialising the context, we can remove the reinitialisation to gain better performance. Change-Id: If0b0e03133058528da943faaeb72ca500d3ddb14 Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-on: http://git-master/r/486673 Reviewed-by: Jussi Rasanen <jrasanen@nvidia.com> Tested-by: Jussi Rasanen <jrasanen@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Lauri Peltonen <lpeltonen@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/nvgpu/gk20a/cde_gk20a.c29
-rw-r--r--drivers/gpu/nvgpu/gk20a/cde_gk20a.h2
2 files changed, 11 insertions, 20 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
index 4c115e5f..57707f54 100644
--- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
@@ -78,6 +78,7 @@ static void gk20a_deinit_cde_img(struct gk20a_cde_ctx *cde_ctx)
78 cde_ctx->num_params = 0; 78 cde_ctx->num_params = 0;
79 cde_ctx->init_cmd_num_entries = 0; 79 cde_ctx->init_cmd_num_entries = 0;
80 cde_ctx->convert_cmd_num_entries = 0; 80 cde_ctx->convert_cmd_num_entries = 0;
81 cde_ctx->init_cmd_executed = false;
81} 82}
82 83
83static int gk20a_cde_remove(struct gk20a_cde_ctx *cde_ctx) 84static int gk20a_cde_remove(struct gk20a_cde_ctx *cde_ctx)
@@ -681,22 +682,6 @@ int gk20a_cde_convert(struct gk20a *g, struct dma_buf *src,
681 goto exit_unlock; 682 goto exit_unlock;
682 } 683 }
683 684
684 /* disable the channel */
685 gk20a_writel(g, ccsr_channel_r(cde_ctx->ch->hw_chid),
686 gk20a_readl(g, ccsr_channel_r(cde_ctx->ch->hw_chid)) |
687 ccsr_channel_enable_clr_true_f());
688 gk20a_fifo_preempt_channel(g, cde_ctx->ch->hw_chid);
689 channel_gk20a_unbind(&g->fifo.channel[cde_ctx->ch->hw_chid]);
690
691 /* reinitialise the graphics context of the channel */
692 gr_gk20a_load_golden_ctx_image(g, cde_ctx->ch);
693
694 /* re-enable the channel */
695 g->ops.fifo.bind_channel(&g->fifo.channel[cde_ctx->ch->hw_chid]);
696 gk20a_writel(g, ccsr_channel_r(cde_ctx->ch->hw_chid),
697 gk20a_readl(g, ccsr_channel_r(cde_ctx->ch->hw_chid)) |
698 ccsr_channel_enable_set_true_f());
699
700 /* store source buffer compression tags */ 685 /* store source buffer compression tags */
701 gk20a_get_comptags(&g->dev->dev, src, &comptags); 686 gk20a_get_comptags(&g->dev->dev, src, &comptags);
702 cde_ctx->src_vaddr = src_vaddr; 687 cde_ctx->src_vaddr = src_vaddr;
@@ -738,10 +723,14 @@ int gk20a_cde_convert(struct gk20a *g, struct dma_buf *src,
738 gk20a_cde_dump(cde_ctx); 723 gk20a_cde_dump(cde_ctx);
739 724
740 /* execute the init push buffer */ 725 /* execute the init push buffer */
741 err = gk20a_cde_execute_buffer(cde_ctx, TYPE_BUF_COMMAND_INIT, 726 if (!cde_ctx->init_cmd_executed) {
742 NULL, 0, NULL); 727 err = gk20a_cde_execute_buffer(cde_ctx, TYPE_BUF_COMMAND_INIT,
743 if (err) 728 NULL, 0, NULL);
744 goto exit_unlock; 729 if (err)
730 goto exit_unlock;
731
732 cde_ctx->init_cmd_executed = true;
733 }
745 734
746 /* take always the postfence as it is needed for protecting the 735 /* take always the postfence as it is needed for protecting the
747 * cde context */ 736 * cde context */
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.h b/drivers/gpu/nvgpu/gk20a/cde_gk20a.h
index 9569f436..4e6a8ec9 100644
--- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.h
@@ -232,6 +232,8 @@ struct gk20a_cde_ctx {
232 int convert_cmd_num_entries; 232 int convert_cmd_num_entries;
233 233
234 struct kobj_attribute attr; 234 struct kobj_attribute attr;
235
236 bool init_cmd_executed;
235}; 237};
236 238
237struct gk20a_cde_app { 239struct gk20a_cde_app {