diff options
author | seshendra Gadagottu <sgadagottu@nvidia.com> | 2017-07-06 01:47:20 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-10-13 18:19:16 -0400 |
commit | a9ce91f910ca730a3abadb9e7491e3504af30d86 (patch) | |
tree | d79e70c782672e6d6281db57a1053e515ee7914a /drivers/gpu/nvgpu/gk20a | |
parent | 017a9f57756f120cb492fc6c66d8588a2c1626d8 (diff) |
gpu: nvgpu: add syncpoint read map
For sync-point read map:
1. Added nvgpu_mem memory allocator in gk20a struct and
allocated memory for this in gk20a_finalize_poweron()
and freed this memory in gk20a_remove().
2. Added "u64 syncpt_ro_map_gpu_va" in vm_gk20a struct
for read map in vm.
Added nvgpu_quiesce() in nvgpu_remove() before freeing
syncpoint read map to ensure that nvgpu is idle.
JIRA GPUT19X-2
Change-Id: I7cbfec57f0992682dd833a1b0d92d694bcaf1eb3
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1514338
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 6 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 11 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 1 |
3 files changed, 15 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c index 380ea048..d83684e4 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | |||
@@ -76,9 +76,9 @@ static int gk20a_channel_syncpt_wait_syncpt(struct gk20a_channel_sync *s, | |||
76 | } | 76 | } |
77 | 77 | ||
78 | nvgpu_log(c->g, gpu_dbg_info, "sp->id %d gpu va %llx", | 78 | nvgpu_log(c->g, gpu_dbg_info, "sp->id %d gpu va %llx", |
79 | id, sp->syncpt_buf.gpu_va); | 79 | id, sp->c->vm->syncpt_ro_map_gpu_va); |
80 | c->g->ops.fifo.add_syncpt_wait_cmd(c->g, wait_cmd, 0, id, | 80 | c->g->ops.fifo.add_syncpt_wait_cmd(c->g, wait_cmd, 0, id, |
81 | thresh, sp->syncpt_buf.gpu_va); | 81 | thresh, c->vm->syncpt_ro_map_gpu_va); |
82 | 82 | ||
83 | return 0; | 83 | return 0; |
84 | } | 84 | } |
@@ -147,7 +147,7 @@ static int gk20a_channel_syncpt_wait_fd(struct gk20a_channel_sync *s, int fd, | |||
147 | wait_id, sp->syncpt_buf.gpu_va); | 147 | wait_id, sp->syncpt_buf.gpu_va); |
148 | c->g->ops.fifo.add_syncpt_wait_cmd(c->g, wait_cmd, | 148 | c->g->ops.fifo.add_syncpt_wait_cmd(c->g, wait_cmd, |
149 | i * wait_cmd_size, wait_id, wait_value, | 149 | i * wait_cmd_size, wait_id, wait_value, |
150 | sp->syncpt_buf.gpu_va); | 150 | c->vm->syncpt_ro_map_gpu_va); |
151 | } | 151 | } |
152 | } | 152 | } |
153 | 153 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index d1ad5992..cac62db7 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -154,6 +154,9 @@ int gk20a_finalize_poweron(struct gk20a *g) | |||
154 | { | 154 | { |
155 | struct gk20a_platform *platform = gk20a_get_platform(dev_from_gk20a(g)); | 155 | struct gk20a_platform *platform = gk20a_get_platform(dev_from_gk20a(g)); |
156 | int err; | 156 | int err; |
157 | #if defined(CONFIG_TEGRA_GK20A_NVHOST) && defined(CONFIG_TEGRA_19x_GPU) | ||
158 | u32 nr_pages; | ||
159 | #endif | ||
157 | 160 | ||
158 | gk20a_dbg_fn(""); | 161 | gk20a_dbg_fn(""); |
159 | 162 | ||
@@ -346,6 +349,14 @@ int gk20a_finalize_poweron(struct gk20a *g) | |||
346 | } | 349 | } |
347 | } | 350 | } |
348 | 351 | ||
352 | #if defined(CONFIG_TEGRA_GK20A_NVHOST) && defined(CONFIG_TEGRA_19x_GPU) | ||
353 | if (gk20a_platform_has_syncpoints(g) && g->syncpt_unit_size) { | ||
354 | nr_pages = DIV_ROUND_UP(g->syncpt_unit_size, PAGE_SIZE); | ||
355 | __nvgpu_mem_create_from_phys(g, &g->syncpt_mem, | ||
356 | g->syncpt_unit_base, nr_pages); | ||
357 | } | ||
358 | #endif | ||
359 | |||
349 | done: | 360 | done: |
350 | if (err) | 361 | if (err) |
351 | g->power_on = false; | 362 | g->power_on = false; |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 72e47ec6..a45a7b4e 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -1293,6 +1293,7 @@ struct gk20a { | |||
1293 | size_t syncpt_unit_size; | 1293 | size_t syncpt_unit_size; |
1294 | u32 syncpt_size; | 1294 | u32 syncpt_size; |
1295 | #endif | 1295 | #endif |
1296 | struct nvgpu_mem syncpt_mem; | ||
1296 | }; | 1297 | }; |
1297 | 1298 | ||
1298 | static inline unsigned long gk20a_get_gr_idle_timeout(struct gk20a *g) | 1299 | static inline unsigned long gk20a_get_gr_idle_timeout(struct gk20a *g) |