From d60a45b9fdd935c5e0c29c2cc3c056e0ce8c9873 Mon Sep 17 00:00:00 2001 From: Vijayakumar Date: Thu, 29 Jan 2015 16:43:13 +0530 Subject: gpu: nvgpu: scale ptimer based timeouts bug 1603226 host based timeouts use ptimer for detecting timeouts. on gk20a and gm20b ptimer runs 2.6x slower. scale the fifo_eng_timeout to account for this Change-Id: Ie44718382953e36436ea47d6e89b9a225d5c2070 Signed-off-by: Vijayakumar Reviewed-on: http://git-master/r/799983 (cherry picked from commit d1d837fd09ff0f035feff1757c67488404c23cc6) Reviewed-on: http://git-master/r/808250 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index f107d83d..8290e7e7 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -886,4 +886,11 @@ void gk20a_user_deinit(struct platform_device *dev); extern void gk20a_debug_dump_device(struct platform_device *pdev); +static inline u32 scale_ptimer(u32 timeout , u32 scale10x) +{ + if (((timeout*10) % scale10x) >= (scale10x/2)) + return ((timeout * 10) / scale10x) + 1; + else + return (timeout * 10) / scale10x; +} #endif /* GK20A_H */ -- cgit v1.2.2