summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.h
diff options
context:
space:
mode:
authorVijayakumar <vsubbu@nvidia.com>2015-01-29 06:13:13 -0500
committerTerje Bergstrom <tbergstrom@nvidia.com>2015-10-06 16:30:54 -0400
commitd60a45b9fdd935c5e0c29c2cc3c056e0ce8c9873 (patch)
tree7ae5d2acc30e9d2fb9dfb55674985cf16b847192 /drivers/gpu/nvgpu/gk20a/gk20a.h
parentf4b6d4d176e9c83b226d8564595b6b9168cef793 (diff)
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 <vsubbu@nvidia.com> Reviewed-on: http://git-master/r/799983 (cherry picked from commit d1d837fd09ff0f035feff1757c67488404c23cc6) Reviewed-on: http://git-master/r/808250 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h7
1 files changed, 7 insertions, 0 deletions
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);
886 886
887extern void gk20a_debug_dump_device(struct platform_device *pdev); 887extern void gk20a_debug_dump_device(struct platform_device *pdev);
888 888
889static inline u32 scale_ptimer(u32 timeout , u32 scale10x)
890{
891 if (((timeout*10) % scale10x) >= (scale10x/2))
892 return ((timeout * 10) / scale10x) + 1;
893 else
894 return (timeout * 10) / scale10x;
895}
889#endif /* GK20A_H */ 896#endif /* GK20A_H */