summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2014-04-11 05:52:58 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:09:10 -0400
commit91724953fdc8a574aebdd3b2d71ce5c1dd295e99 (patch)
tree009997694a92bba314d0ae4b166db0d0d0c33578 /drivers/gpu/nvgpu
parent53622e893133211a3b8212c3c59eb52b08e141b1 (diff)
gpu: nvgpu: gk20a: allow syncpt free at channel_unbind()
Add infrastructure to allow freeing gpu channels' syncpts at channel_unbind() Currently, we free the syncpt at channel_free() only. But we can free the syncpt when channel becomes idle. When we do channel_unbind(), channel cannot be scheduled and hence we can destroy its syncpt. Channel will request again for new syncpt when it has new work to do. This feature will be enabled with boolean flag syncpt_aggressive_destroy Bug 1305024 Change-Id: Ib498e2c371e36ffc1430d4f95f2780b4c587e43e Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/395153 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c10
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index f90bc1a3..1cc0f154 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -351,6 +351,16 @@ static void channel_gk20a_unbind(struct channel_gk20a *ch_gk20a)
351 ccsr_channel_inst_bind_false_f()); 351 ccsr_channel_inst_bind_false_f());
352 352
353 ch_gk20a->bound = false; 353 ch_gk20a->bound = false;
354
355 /*
356 * if we are agrressive then we can destroy the syncpt
357 * resource at this point
358 * if not, then it will be destroyed at channel_free()
359 */
360 if (ch_gk20a->sync && ch_gk20a->sync->syncpt_aggressive_destroy) {
361 ch_gk20a->sync->destroy(ch_gk20a->sync);
362 ch_gk20a->sync = NULL;
363 }
354} 364}
355 365
356static int channel_gk20a_alloc_inst(struct gk20a *g, 366static int channel_gk20a_alloc_inst(struct gk20a *g,
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
index 69feb89f..80f38b26 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
@@ -94,6 +94,9 @@ struct gk20a_channel_sync {
94 /* Reset the channel syncpoint/semaphore. */ 94 /* Reset the channel syncpoint/semaphore. */
95 void (*set_min_eq_max)(struct gk20a_channel_sync *s); 95 void (*set_min_eq_max)(struct gk20a_channel_sync *s);
96 96
97 /* flag to set syncpt destroy aggressiveness */
98 bool syncpt_aggressive_destroy;
99
97 /* Free the resources allocated by gk20a_channel_sync_create. */ 100 /* Free the resources allocated by gk20a_channel_sync_create. */
98 void (*destroy)(struct gk20a_channel_sync *s); 101 void (*destroy)(struct gk20a_channel_sync *s);
99}; 102};