From d8833c6da35c99d73f817e614f327e5617788860 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Tue, 26 Jun 2018 12:22:29 +0300 Subject: gpu: nvgpu: remove unnecessary nvgpu_memset calls Some graphics context buffers are explicitly cleared to zero after allocation. That's not necessary because the allocator gives zero-initialized memory already, so remove the clears. Change-Id: I8f9913605801e35082762e7743762d97f88e1d12 Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1761578 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 3 --- drivers/gpu/nvgpu/gv11b/subctx_gv11b.c | 2 -- 2 files changed, 5 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index b218397a..d787a693 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -1763,9 +1763,6 @@ int gr_gk20a_update_hwpm_ctxsw_mode(struct gk20a *g, return -ENOMEM; } } - - /* Now clear the buffer */ - nvgpu_memset(g, &pm_ctx->mem, 0, 0, pm_ctx->mem.size); } data = nvgpu_mem_rd(g, gr_mem, ctxsw_prog_main_image_pm_o()); diff --git a/drivers/gpu/nvgpu/gv11b/subctx_gv11b.c b/drivers/gpu/nvgpu/gv11b/subctx_gv11b.c index 4f8de196..b0bcb585 100644 --- a/drivers/gpu/nvgpu/gv11b/subctx_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/subctx_gv11b.c @@ -79,8 +79,6 @@ int gv11b_alloc_subctx_header(struct channel_gk20a *c) nvgpu_dma_free(g, &ctx->mem); return -ENOMEM; } - /* Now clear the buffer */ - nvgpu_memset(g, &ctx->mem, 0, 0, ctx->mem.size); } return ret; } -- cgit v1.2.2