From 31a436b3a1720f0ff3ab51d102c55c09c7e247fd Mon Sep 17 00:00:00 2001 From: Timo Alho Date: Thu, 4 Dec 2014 00:53:17 -0800 Subject: Revert "gpu: nvgpu: Enable syncpt reclaim only on gm20b" This reverts commit 8eefb93c21934b101d7f423c38d9ea384a45fad6. Bug 1585422 Change-Id: I217e0ffe6c230ee3c63d9aec1c48ce9c41770468 Signed-off-by: Timo Alho Reviewed-on: http://git-master/r/659426 --- 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, 12 insertions(+), 11 deletions(-) (limited to 'drivers/gpu/nvgpu') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 03163575..de51e83e 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -318,7 +318,6 @@ 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(""); @@ -334,7 +333,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 && platform->sync_aggressive_destroy) { + if (ch_gk20a->sync && ch_gk20a->sync->aggressive_destroy) { ch_gk20a->sync->destroy(ch_gk20a->sync); ch_gk20a->sync = NULL; } @@ -1470,7 +1469,6 @@ 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); @@ -1508,7 +1506,7 @@ void gk20a_channel_update(struct channel_gk20a *c, int nr_completed) * the sync resource */ if (list_empty(&c->jobs)) { - if (c->sync && platform->sync_aggressive_destroy && + if (c->sync && c->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 a27f08a4..746a2de3 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c @@ -305,6 +305,8 @@ 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 */ @@ -642,6 +644,10 @@ 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 b2deaff8..a3cd8208 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h @@ -86,6 +86,9 @@ 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 cd68f8e1..f4301dab 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h @@ -46,7 +46,6 @@ 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 9d17aa86..dfbc1ae0 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c @@ -584,11 +584,6 @@ 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 5310088f..24b9f4be 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 && platform->sync_aggressive_destroy) { + if (ch->sync && ch->sync->aggressive_destroy) { ch->sync->destroy(ch->sync); ch->sync = NULL; } -- cgit v1.2.2