From d42ca3a0fc70473135a90013515c739da57319a9 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 12 Jun 2015 08:42:27 -0700 Subject: gpu: nvgpu: gp10b: Lazy sync point update Update sync point protection field only when we have a valid sync point id, and the new id is different from old id. Bug 1653328 Change-Id: Ie07e26f8abd7c8239ad562603b62fda00164cbc7 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/757102 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Deepak Nibade Reviewed-by: Konsta Holtta --- drivers/gpu/nvgpu/gp10b/fifo_gp10b.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'drivers/gpu/nvgpu/gp10b/fifo_gp10b.c') diff --git a/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c b/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c index 3a6c3c23..8c53978b 100644 --- a/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c @@ -150,31 +150,34 @@ static u32 gp10b_fifo_get_pbdma_signature(struct gk20a *g) static int gp10b_fifo_resetup_ramfc(struct channel_gk20a *c) { - int syncpt_id; + u32 new_syncpt = 0, old_syncpt; void *inst_ptr; + u32 v; gk20a_dbg_fn(""); inst_ptr = c->inst_block.cpu_va; - /* disable channel */ - c->g->ops.fifo.disable_channel(c); + v = gk20a_mem_rd32(inst_ptr, ram_fc_allowed_syncpoints_w()); + old_syncpt = pbdma_allowed_syncpoints_0_index_v(v); + if (c->sync) + new_syncpt = c->sync->syncpt_id(c->sync); - /* preempt the channel */ - WARN_ON(c->g->ops.fifo.preempt_channel(c->g, c->hw_chid)); + if (new_syncpt && new_syncpt != old_syncpt) { + /* disable channel */ + c->g->ops.fifo.disable_channel(c); - if (c->sync) { - u32 v = pbdma_allowed_syncpoints_0_valid_f(1); + /* preempt the channel */ + WARN_ON(c->g->ops.fifo.preempt_channel(c->g, c->hw_chid)); + + v = pbdma_allowed_syncpoints_0_valid_f(1); - syncpt_id = c->sync->syncpt_id(c->sync); gk20a_dbg_info("Channel %d, syncpt id %d\n", - c->hw_chid, syncpt_id); + c->hw_chid, new_syncpt); - v |= pbdma_allowed_syncpoints_0_index_f(syncpt_id); + v |= pbdma_allowed_syncpoints_0_index_f(new_syncpt); gk20a_mem_wr32(inst_ptr, ram_fc_allowed_syncpoints_w(), v); - } else { - gk20a_mem_wr32(inst_ptr, ram_fc_allowed_syncpoints_w(), 0); } /* enable channel */ -- cgit v1.2.2