summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/hw_top_gk20a.h
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2016-05-13 10:56:43 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-05-18 11:15:11 -0400
commit67a41e46a230cde7353e4cd46040f1e71d7cd289 (patch)
tree0697ce5ba224db6a92cdab0b192a8069f669be63 /drivers/gpu/nvgpu/gk20a/hw_top_gk20a.h
parent8f48afe26bc39fd7508646e8c3ea6bfeb665beae (diff)
gpu: nvgpu: Read all fields of device_info
We were not using the engine_type field in device info, and the code did not handle chained entries properly. The code assumed that first entry is for graphics and second for CE, which is not always true. Improve the code to go through all entries of device_info, and preserve values across entries until we reach the last entry. Only last entry triggers a write to fifo engine info. There can also be multiple engines with same type, so accumulate interrupts and reset ids from all of them. As the code got fixed, now it reads the engine enum correctly from hardware. We used to compare that against CE0, but we should compare against CE2. gk20a_fifo_reset_engine() uses wrong constants - it is passed a internal numbering of engines, but it compares them against hardware engine enum. Change-Id: Ia59273921c602d2a090f7a5b1404afb0fca2532c Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1147746 Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/hw_top_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/hw_top_gk20a.h30
1 files changed, 25 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/hw_top_gk20a.h b/drivers/gpu/nvgpu/gk20a/hw_top_gk20a.h
index 35d9d347..6981cf71 100644
--- a/drivers/gpu/nvgpu/gk20a/hw_top_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/hw_top_gk20a.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2012-2015, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2012-2016, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -118,13 +118,29 @@ static inline u32 top_device_info_type_enum_graphics_f(void)
118{ 118{
119 return 0x0; 119 return 0x0;
120} 120}
121static inline u32 top_device_info_type_enum_copy0_v(void) 121static inline u32 top_device_info_type_enum_copy2_v(void)
122{ 122{
123 return 0x00000001; 123 return 0x00000003;
124}
125static inline u32 top_device_info_type_enum_copy2_f(void)
126{
127 return 0xc;
124} 128}
125static inline u32 top_device_info_type_enum_copy0_f(void) 129static inline u32 top_device_info_engine_v(u32 r)
126{ 130{
127 return 0x4; 131 return (r >> 5) & 0x1;
132}
133static inline u32 top_device_info_runlist_v(u32 r)
134{
135 return (r >> 4) & 0x1;
136}
137static inline u32 top_device_info_intr_v(u32 r)
138{
139 return (r >> 3) & 0x1;
140}
141static inline u32 top_device_info_reset_v(u32 r)
142{
143 return (r >> 2) & 0x1;
128} 144}
129static inline u32 top_device_info_entry_v(u32 r) 145static inline u32 top_device_info_entry_v(u32 r)
130{ 146{
@@ -138,6 +154,10 @@ static inline u32 top_device_info_entry_enum_v(void)
138{ 154{
139 return 0x00000002; 155 return 0x00000002;
140} 156}
157static inline u32 top_device_info_entry_engine_type_v(void)
158{
159 return 0x00000003;
160}
141static inline u32 top_fs_status_fbp_r(void) 161static inline u32 top_fs_status_fbp_r(void)
142{ 162{
143 return 0x00022548; 163 return 0x00022548;