summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2014-11-28 05:51:35 -0500
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:12:25 -0400
commit36834282354de2760e54b1381e03e0fe8bc8b2a4 (patch)
treecce5b221077f047fc2f9fd83b379b7f20e604c1e /drivers
parent0d11ff0c9cd39b2ee6433b296c5ba029355e1c44 (diff)
gpu: nvgpu: Enable syncpt reclaim only on gm20b
gm20b has more channels than sync points. We use aggressive reclaim of sync points to offset that. Disable aggressive reclaim for gk20a because it is not needed there. Bug 1583849 Change-Id: I2a74b0504150a54cb8a97016effe20c5d905ac95 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/657095 Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c6
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c6
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h3
-rw-r--r--drivers/gpu/nvgpu/gk20a/platform_gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c5
-rw-r--r--drivers/gpu/nvgpu/vgpu/fifo_vgpu.c2
6 files changed, 11 insertions, 12 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index de51e83e..03163575 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -318,6 +318,7 @@ static void channel_gk20a_bind(struct channel_gk20a *ch_gk20a)
318void channel_gk20a_unbind(struct channel_gk20a *ch_gk20a) 318void channel_gk20a_unbind(struct channel_gk20a *ch_gk20a)
319{ 319{
320 struct gk20a *g = ch_gk20a->g; 320 struct gk20a *g = ch_gk20a->g;
321 struct gk20a_platform *platform = gk20a_get_platform(g->dev);
321 322
322 gk20a_dbg_fn(""); 323 gk20a_dbg_fn("");
323 324
@@ -333,7 +334,7 @@ void channel_gk20a_unbind(struct channel_gk20a *ch_gk20a)
333 * resource at this point 334 * resource at this point
334 * if not, then it will be destroyed at channel_free() 335 * if not, then it will be destroyed at channel_free()
335 */ 336 */
336 if (ch_gk20a->sync && ch_gk20a->sync->aggressive_destroy) { 337 if (ch_gk20a->sync && platform->sync_aggressive_destroy) {
337 ch_gk20a->sync->destroy(ch_gk20a->sync); 338 ch_gk20a->sync->destroy(ch_gk20a->sync);
338 ch_gk20a->sync = NULL; 339 ch_gk20a->sync = NULL;
339 } 340 }
@@ -1469,6 +1470,7 @@ void gk20a_channel_update(struct channel_gk20a *c, int nr_completed)
1469{ 1470{
1470 struct vm_gk20a *vm = c->vm; 1471 struct vm_gk20a *vm = c->vm;
1471 struct channel_gk20a_job *job, *n; 1472 struct channel_gk20a_job *job, *n;
1473 struct gk20a_platform *platform = gk20a_get_platform(c->g->dev);
1472 1474
1473 trace_gk20a_channel_update(c); 1475 trace_gk20a_channel_update(c);
1474 1476
@@ -1506,7 +1508,7 @@ void gk20a_channel_update(struct channel_gk20a *c, int nr_completed)
1506 * the sync resource 1508 * the sync resource
1507 */ 1509 */
1508 if (list_empty(&c->jobs)) { 1510 if (list_empty(&c->jobs)) {
1509 if (c->sync && c->sync->aggressive_destroy && 1511 if (c->sync && platform->sync_aggressive_destroy &&
1510 gk20a_fence_is_expired(c->last_submit.post_fence)) { 1512 gk20a_fence_is_expired(c->last_submit.post_fence)) {
1511 c->sync->destroy(c->sync); 1513 c->sync->destroy(c->sync);
1512 c->sync = NULL; 1514 c->sync = NULL;
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
index 746a2de3..a27f08a4 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
@@ -305,8 +305,6 @@ gk20a_channel_syncpt_create(struct channel_gk20a *c)
305 sp->ops.signal_timeline = gk20a_channel_syncpt_signal_timeline; 305 sp->ops.signal_timeline = gk20a_channel_syncpt_signal_timeline;
306 sp->ops.destroy = gk20a_channel_syncpt_destroy; 306 sp->ops.destroy = gk20a_channel_syncpt_destroy;
307 307
308 sp->ops.aggressive_destroy = true;
309
310 return &sp->ops; 308 return &sp->ops;
311} 309}
312#endif /* CONFIG_TEGRA_GK20A */ 310#endif /* CONFIG_TEGRA_GK20A */
@@ -644,10 +642,6 @@ gk20a_channel_semaphore_create(struct channel_gk20a *c)
644 sema->ops.signal_timeline = gk20a_channel_semaphore_signal_timeline; 642 sema->ops.signal_timeline = gk20a_channel_semaphore_signal_timeline;
645 sema->ops.destroy = gk20a_channel_semaphore_destroy; 643 sema->ops.destroy = gk20a_channel_semaphore_destroy;
646 644
647 /* Aggressively destroying the semaphore sync would cause overhead
648 * since the pool needs to be mapped to GMMU. */
649 sema->ops.aggressive_destroy = false;
650
651 return &sema->ops; 645 return &sema->ops;
652clean_up: 646clean_up:
653 gk20a_channel_semaphore_destroy(&sema->ops); 647 gk20a_channel_semaphore_destroy(&sema->ops);
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
index a3cd8208..b2deaff8 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
@@ -86,9 +86,6 @@ struct gk20a_channel_sync {
86 * expired. */ 86 * expired. */
87 void (*signal_timeline)(struct gk20a_channel_sync *s); 87 void (*signal_timeline)(struct gk20a_channel_sync *s);
88 88
89 /* flag to set sync destroy aggressiveness */
90 bool aggressive_destroy;
91
92 /* Free the resources allocated by gk20a_channel_sync_create. */ 89 /* Free the resources allocated by gk20a_channel_sync_create. */
93 void (*destroy)(struct gk20a_channel_sync *s); 90 void (*destroy)(struct gk20a_channel_sync *s);
94}; 91};
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
index f4301dab..cd68f8e1 100644
--- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
@@ -46,6 +46,7 @@ struct gk20a_platform {
46 46
47 /* Should be populated at probe. */ 47 /* Should be populated at probe. */
48 bool has_syncpoints; 48 bool has_syncpoints;
49 bool sync_aggressive_destroy;
49 50
50 /* Should be populated by probe. */ 51 /* Should be populated by probe. */
51 struct dentry *debugfs; 52 struct dentry *debugfs;
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c
index dfbc1ae0..9d17aa86 100644
--- a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c
+++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c
@@ -584,6 +584,11 @@ struct gk20a_platform gk20a_tegra_platform = {
584 584
585struct gk20a_platform gm20b_tegra_platform = { 585struct gk20a_platform gm20b_tegra_platform = {
586 .has_syncpoints = true, 586 .has_syncpoints = true,
587 /*
588 * Enable aggressive reclaiming of sync point, becuase we have
589 * fewer sync points than channels
590 */
591 .sync_aggressive_destroy = true,
587 592
588 /* power management configuration */ 593 /* power management configuration */
589 .railgate_delay = 500, 594 .railgate_delay = 500,
diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
index 24b9f4be..5310088f 100644
--- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
@@ -63,7 +63,7 @@ static void vgpu_channel_unbind(struct channel_gk20a *ch)
63 * resource at this point 63 * resource at this point
64 * if not, then it will be destroyed at channel_free() 64 * if not, then it will be destroyed at channel_free()
65 */ 65 */
66 if (ch->sync && ch->sync->aggressive_destroy) { 66 if (ch->sync && platform->sync_aggressive_destroy) {
67 ch->sync->destroy(ch->sync); 67 ch->sync->destroy(ch->sync);
68 ch->sync = NULL; 68 ch->sync = NULL;
69 } 69 }