From bee9c830c7898ceebf8c396b40598350229a7203 Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Thu, 22 Jun 2017 16:25:41 -0700 Subject: gpu: nvgpu: allocate syncpoint read map only once Allocate syncpt_mem only if is not allocated. JIRA GPUT19X-2 Change-Id: I081d27bb784fbe653890b5f8d36a4295c7ccc19b Signed-off-by: seshendra Gadagottu Reviewed-on: https://git-master.nvidia.com/r/1580731 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index a4becda0..e1bf2b4b 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -325,9 +325,11 @@ int gk20a_finalize_poweron(struct gk20a *g) #if defined(CONFIG_TEGRA_GK20A_NVHOST) && defined(CONFIG_TEGRA_19x_GPU) if (gk20a_platform_has_syncpoints(g) && g->syncpt_unit_size) { - nr_pages = DIV_ROUND_UP(g->syncpt_unit_size, PAGE_SIZE); - __nvgpu_mem_create_from_phys(g, &g->syncpt_mem, - g->syncpt_unit_base, nr_pages); + if (!nvgpu_mem_is_valid(&g->syncpt_mem)) { + nr_pages = DIV_ROUND_UP(g->syncpt_unit_size, PAGE_SIZE); + __nvgpu_mem_create_from_phys(g, &g->syncpt_mem, + g->syncpt_unit_base, nr_pages); + } } #endif -- cgit v1.2.2