From 09dba979a85855d4bdfafbb4bf18eefab3d71099 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 4 Jan 2017 15:23:01 -0800 Subject: gpu: nvgpu: Update patch count after adding When kernel adds patches to a context, kernel needs to update the patch count in order for FECS to pick up the new patches. Previously patching was done only at the context creation time. Now patching is used also when changing preemption mode, but the patches did not take effect due to not updating count. Update patch count every time we end patching of a context. Bug 1852094 Change-Id: Ic2150741609d1d1956769e439ce1c5f2edcacb84 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1280424 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 94f66e83..54c96680 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -670,6 +670,12 @@ void gr_gk20a_ctx_patch_write_end(struct gk20a *g, struct channel_ctx_gk20a *ch_ctx) { gk20a_mem_end(g, &ch_ctx->patch_ctx.mem); + /* Write context count to context image if it is mapped */ + if (ch_ctx->gr_ctx->mem.cpu_va) { + gk20a_mem_wr(g, &ch_ctx->gr_ctx->mem, + ctxsw_prog_main_image_patch_count_o(), + ch_ctx->patch_ctx.data_count); + } } void gr_gk20a_ctx_patch_write(struct gk20a *g, -- cgit v1.2.2