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 <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1580731
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
seshendra Gadagottu
2017-06-22 16:25:41 -07:00
committed by mobile promotions
parent e039dcbc9d
commit bee9c830c7

View File

@@ -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