From 278b765836b53a92e1b5b15a533221119de27669 Mon Sep 17 00:00:00 2001 From: Peter Boonstoppel Date: Wed, 12 Apr 2017 11:47:45 -0700 Subject: gpu: nvgpu: Fix submit profiling stat reporting The debugfs submit profiling stats report the distribution of submit times at different percentiles. The original code reports the lowest entry in every percentile-bin as being representative for that bin. This means that where debugfs reports the 50th percentile, it actually reports the ~45.001th percentile. This is especially inconveniant when looking at the 100th percentile, which does not in fact reflect the maximum. This patch changes the code to instead report the highest entry in every percentile-bin. Change-Id: Ibde3aaf6445e08af09a4a96156f8421cbeb8bae5 Signed-off-by: Peter Boonstoppel Reviewed-on: http://git-master/r/1461658 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index ad200f38..519fa509 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -3626,8 +3626,8 @@ static unsigned int __gk20a_fifo_create_stats(struct gk20a *g, /* build ranges */ for (index = 0; index < PERCENTILE_RANGES; index++) percentiles[index] = - g->fifo.profile.sorted[(PERCENTILE_WIDTH * index * - nelem)/100]; + g->fifo.profile.sorted[(PERCENTILE_WIDTH * (index + 1) * + nelem)/100 - 1]; return nelem; } -- cgit v1.2.2