summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2015-07-10 07:15:48 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2015-12-09 13:17:58 -0500
commiteb81d7d7e1d4a34ecd5968b13636f2c0e7a0dce1 (patch)
tree57603261454049f29984a2eff72ca2cd7dda8191 /drivers/gpu/nvgpu/gk20a/gr_gk20a.c
parent8feddd88d03c7f26adb856d4ff98f5e17e405a21 (diff)
gpu: nvgpu: optimize map calls in patch smpc
Copy the necessary ctx patching prologues and epilogues from patch_write to gr_gk20a_exec_ctx_ops next to mapping of gr ctx, around a loop that applies patches multiple times, in order to optimize the number of maps/unmaps on the channel's patch context. Bug 200075565 Change-Id: I7125be5c778192d639f0bbed1731bb900c7015da Signed-off-by: Konsta Holtta <kholtta@nvidia.com> (cherry picked from commit TODO-FILL-THIS-WHEN-MERGED) Reviewed-on: http://git-master/r/839203 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index adb4b276..34ad1771 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -648,7 +648,6 @@ int gr_gk20a_ctx_patch_write(struct gk20a *g,
648 if (!ch_ctx->patch_ctx.mem.cpu_va) { 648 if (!ch_ctx->patch_ctx.mem.cpu_va) {
649 int err; 649 int err;
650 gk20a_dbg_info("per-write ctx patch begin?"); 650 gk20a_dbg_info("per-write ctx patch begin?");
651 /* yes, gr_gk20a_ctx_patch_smpc causes this one */
652 err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx); 651 err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx);
653 if (err) 652 if (err)
654 return err; 653 return err;
@@ -6759,6 +6758,9 @@ int gr_gk20a_exec_ctx_ops(struct channel_gk20a *ch,
6759 err = -ENOMEM; 6758 err = -ENOMEM;
6760 goto cleanup; 6759 goto cleanup;
6761 } 6760 }
6761 err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx);
6762 if (err)
6763 goto cleanup;
6762 6764
6763 g->ops.mm.l2_flush(g, true); 6765 g->ops.mm.l2_flush(g, true);
6764 6766
@@ -6863,6 +6865,9 @@ int gr_gk20a_exec_ctx_ops(struct channel_gk20a *ch,
6863 if (offsets) 6865 if (offsets)
6864 kfree(offsets); 6866 kfree(offsets);
6865 6867
6868 if (ch_ctx->patch_ctx.mem.cpu_va)
6869 gr_gk20a_ctx_patch_write_end(g, ch_ctx);
6870
6866 if (ctx_ptr) 6871 if (ctx_ptr)
6867 vunmap(ctx_ptr); 6872 vunmap(ctx_ptr);
6868 6873