From 36834282354de2760e54b1381e03e0fe8bc8b2a4 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 28 Nov 2014 12:51:35 +0200 Subject: 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 Reviewed-on: http://git-master/r/657095 Reviewed-by: Deepak Nibade --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 6 ++++-- drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 6 ------ drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h | 3 --- drivers/gpu/nvgpu/gk20a/platform_gk20a.h | 1 + drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c | 5 +++++ drivers/gpu/nvgpu/vgpu/fifo_vgpu.c | 2 +- 6 files changed, 11 insertions(+), 12 deletions(-) (limited to 'drivers') 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) void channel_gk20a_unbind(struct channel_gk20a *ch_gk20a) { struct gk20a *g = ch_gk20a->g; + struct gk20a_platform *platform = gk20a_get_platform(g->dev); gk20a_dbg_fn(""); @@ -333,7 +334,7 @@ void channel_gk20a_unbind(struct channel_gk20a *ch_gk20a) * resource at this point * if not, then it will be destroyed at channel_free() */ - if (ch_gk20a->sync && ch_gk20a->sync->aggressive_destroy) { + if (ch_gk20a->sync && platform->sync_aggressive_destroy) { ch_gk20a->sync->destroy(ch_gk20a->sync); ch_gk20a->sync = NULL; } @@ -1469,6 +1470,7 @@ void gk20a_channel_update(struct channel_gk20a *c, int nr_completed) { struct vm_gk20a *vm = c->vm; struct channel_gk20a_job *job, *n; + struct gk20a_platform *platform = gk20a_get_platform(c->g->dev); trace_gk20a_channel_update(c); @@ -1506,7 +1508,7 @@ void gk20a_channel_update(struct channel_gk20a *c, int nr_completed) * the sync resource */ if (list_empty(&c->jobs)) { - if (c->sync && c->sync->aggressive_destroy && + if (c->sync && platform->sync_aggressive_destroy && gk20a_fence_is_expired(c->last_submit.post_fence)) { c->sync->destroy(c->sync); 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) sp->ops.signal_timeline = gk20a_channel_syncpt_signal_timeline; sp->ops.destroy = gk20a_channel_syncpt_destroy; - sp->ops.aggressive_destroy = true; - return &sp->ops; } #endif /* CONFIG_TEGRA_GK20A */ @@ -644,10 +642,6 @@ gk20a_channel_semaphore_create(struct channel_gk20a *c) sema->ops.signal_timeline = gk20a_channel_semaphore_signal_timeline; sema->ops.destroy = gk20a_channel_semaphore_destroy; - /* Aggressively destroying the semaphore sync would cause overhead - * since the pool needs to be mapped to GMMU. */ - sema->ops.aggressive_destroy = false; - return &sema->ops; clean_up: 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 { * expired. */ void (*signal_timeline)(struct gk20a_channel_sync *s); - /* flag to set sync destroy aggressiveness */ - bool aggressive_destroy; - /* Free the resources allocated by gk20a_channel_sync_create. */ void (*destroy)(struct gk20a_channel_sync *s); }; 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 { /* Should be populated at probe. */ bool has_syncpoints; + bool sync_aggressive_destroy; /* Should be populated by probe. */ 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 = { struct gk20a_platform gm20b_tegra_platform = { .has_syncpoints = true, + /* + * Enable aggressive reclaiming of sync point, becuase we have + * fewer sync points than channels + */ + .sync_aggressive_destroy = true, /* power management configuration */ .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) * resource at this point * if not, then it will be destroyed at channel_free() */ - if (ch->sync && ch->sync->aggressive_destroy) { + if (ch->sync && platform->sync_aggressive_destroy) { ch->sync->destroy(ch->sync); ch->sync = NULL; } -- cgit v1.2.2