From 0bb1f4595885714057fa5399e3ee7a6ce5422de1 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Wed, 20 Jul 2016 10:00:50 +0300 Subject: gpu: nvgpu: optimize barrier in batch pramin writes Move wmb() before the loop in pramin-accessed batch writes and use writel_relaxed() directly, instead of calling gk20a_writel() that would do wmb() on each iteration separately. Jira DNVGPU-24 Change-Id: I4c1375a819266727f97e2f109d3132b5b0974ac6 Signed-off-by: Konsta Holtta Reviewed-on: http://git-master/r/1213600 (cherry picked from commit 79e3e38e0c5384ababfd55b8e6cd9723eb8f7b66) Reviewed-on: http://git-master/r/1184343 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 1551dd16..a84d8ff0 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c @@ -229,8 +229,14 @@ static inline void pramin_access_batch_wr_n(struct gk20a *g, u32 start, { u32 r = start, *src_u32 = *arg; + /* + * Barrier moved here from gk20a_writel in the loop. The writes don't + * have to be ordered. + */ + wmb(); + while (words--) { - gk20a_writel(g, r, *src_u32++); + writel_relaxed(*src_u32++, g->regs + r); r += sizeof(u32); } @@ -242,8 +248,14 @@ static inline void pramin_access_batch_set(struct gk20a *g, u32 start, { u32 r = start, repeat = **arg; + /* + * Barrier moved here from gk20a_writel in the loop. The writes don't + * have to be ordered. + */ + wmb(); + while (words--) { - gk20a_writel(g, r, repeat); + writel_relaxed(repeat, g->regs + r); r += sizeof(u32); } } -- cgit v1.2.2