diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/cde_gk20a.c | 29 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/cde_gk20a.h | 2 |
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 | ||
83 | static int gk20a_cde_remove(struct gk20a_cde_ctx *cde_ctx) | 84 | static 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 | ||
237 | struct gk20a_cde_app { | 239 | struct gk20a_cde_app { |