mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
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>
This commit is contained in:
committed by
Terje Bergstrom
parent
8feddd88d0
commit
eb81d7d7e1
@@ -648,7 +648,6 @@ int gr_gk20a_ctx_patch_write(struct gk20a *g,
|
||||
if (!ch_ctx->patch_ctx.mem.cpu_va) {
|
||||
int err;
|
||||
gk20a_dbg_info("per-write ctx patch begin?");
|
||||
/* yes, gr_gk20a_ctx_patch_smpc causes this one */
|
||||
err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx);
|
||||
if (err)
|
||||
return err;
|
||||
@@ -6759,6 +6758,9 @@ int gr_gk20a_exec_ctx_ops(struct channel_gk20a *ch,
|
||||
err = -ENOMEM;
|
||||
goto cleanup;
|
||||
}
|
||||
err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx);
|
||||
if (err)
|
||||
goto cleanup;
|
||||
|
||||
g->ops.mm.l2_flush(g, true);
|
||||
|
||||
@@ -6863,6 +6865,9 @@ int gr_gk20a_exec_ctx_ops(struct channel_gk20a *ch,
|
||||
if (offsets)
|
||||
kfree(offsets);
|
||||
|
||||
if (ch_ctx->patch_ctx.mem.cpu_va)
|
||||
gr_gk20a_ctx_patch_write_end(g, ch_ctx);
|
||||
|
||||
if (ctx_ptr)
|
||||
vunmap(ctx_ptr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user