diff options
author | Vinod G <vinodg@nvidia.com> | 2018-08-08 02:09:30 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-08-25 05:10:43 -0400 |
commit | bfe65407bde2b5d0776724301e215c6553c989f3 (patch) | |
tree | f68a01361052afe1c30a0c6dcd5d359b762e647a /drivers/gpu/nvgpu/gk20a/tsg_gk20a.h | |
parent | 3bd47da0954d3486d9ccd3c396f84445918f82b4 (diff) |
gpu: nvgpu: Read sm error ioctl support for tsg
Add READ_SM_ERROR IOCTL support to TSG level.
Moved the struct to save the sm_error details
from gr to tsg as the sm_error support is context
based, not global.
Also corrected MISRA 21.1 error in header file.
nvgpu_dbg_gpu_ioctl_write_single_sm_error_state and
nvgpu_dbg_gpu_ioctl_read_single_sm_error_state
functions are modified to use the tsg struct
nvgpu_tsg_sm_error_state.
Bug 200412642
Change-Id: I9e334b059078a4bb0e360b945444cc4bf1cc56ec
Signed-off-by: Vinod G <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1794856
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/tsg_gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/tsg_gk20a.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h index 552c3bb3..67ccb9f5 100644 --- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h | |||
@@ -19,8 +19,8 @@ | |||
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | * DEALINGS IN THE SOFTWARE. | 20 | * DEALINGS IN THE SOFTWARE. |
21 | */ | 21 | */ |
22 | #ifndef __TSG_GK20A_H_ | 22 | #ifndef TSG_GK20A_H |
23 | #define __TSG_GK20A_H_ | 23 | #define TSG_GK20A_H |
24 | 24 | ||
25 | #include <nvgpu/lock.h> | 25 | #include <nvgpu/lock.h> |
26 | #include <nvgpu/kref.h> | 26 | #include <nvgpu/kref.h> |
@@ -39,6 +39,14 @@ void gk20a_tsg_release(struct nvgpu_ref *ref); | |||
39 | int gk20a_init_tsg_support(struct gk20a *g, u32 tsgid); | 39 | int gk20a_init_tsg_support(struct gk20a *g, u32 tsgid); |
40 | struct tsg_gk20a *tsg_gk20a_from_ch(struct channel_gk20a *ch); | 40 | struct tsg_gk20a *tsg_gk20a_from_ch(struct channel_gk20a *ch); |
41 | 41 | ||
42 | struct nvgpu_tsg_sm_error_state { | ||
43 | u32 hww_global_esr; | ||
44 | u32 hww_warp_esr; | ||
45 | u64 hww_warp_esr_pc; | ||
46 | u32 hww_global_esr_report_mask; | ||
47 | u32 hww_warp_esr_report_mask; | ||
48 | }; | ||
49 | |||
42 | struct tsg_gk20a { | 50 | struct tsg_gk20a { |
43 | struct gk20a *g; | 51 | struct gk20a *g; |
44 | 52 | ||
@@ -69,6 +77,7 @@ struct tsg_gk20a { | |||
69 | bool tpc_num_initialized; | 77 | bool tpc_num_initialized; |
70 | bool in_use; | 78 | bool in_use; |
71 | 79 | ||
80 | struct nvgpu_tsg_sm_error_state *sm_error_states; | ||
72 | }; | 81 | }; |
73 | 82 | ||
74 | int gk20a_enable_tsg(struct tsg_gk20a *tsg); | 83 | int gk20a_enable_tsg(struct tsg_gk20a *tsg); |
@@ -84,6 +93,12 @@ int gk20a_tsg_set_timeslice(struct tsg_gk20a *tsg, u32 timeslice); | |||
84 | u32 gk20a_tsg_get_timeslice(struct tsg_gk20a *tsg); | 93 | u32 gk20a_tsg_get_timeslice(struct tsg_gk20a *tsg); |
85 | int gk20a_tsg_set_priority(struct gk20a *g, struct tsg_gk20a *tsg, | 94 | int gk20a_tsg_set_priority(struct gk20a *g, struct tsg_gk20a *tsg, |
86 | u32 priority); | 95 | u32 priority); |
96 | int gk20a_tsg_alloc_sm_error_states_mem(struct gk20a *g, | ||
97 | struct tsg_gk20a *tsg, | ||
98 | u32 num_sm); | ||
99 | void gk20a_tsg_update_sm_error_state_locked(struct tsg_gk20a *tsg, | ||
100 | u32 sm_id, | ||
101 | struct nvgpu_tsg_sm_error_state *sm_error_state); | ||
87 | 102 | ||
88 | struct gk20a_event_id_data { | 103 | struct gk20a_event_id_data { |
89 | struct gk20a *g; | 104 | struct gk20a *g; |
@@ -106,4 +121,4 @@ gk20a_event_id_data_from_event_id_node(struct nvgpu_list_node *node) | |||
106 | ((uintptr_t)node - offsetof(struct gk20a_event_id_data, event_id_node)); | 121 | ((uintptr_t)node - offsetof(struct gk20a_event_id_data, event_id_node)); |
107 | }; | 122 | }; |
108 | 123 | ||
109 | #endif /* __TSG_GK20A_H_ */ | 124 | #endif /* TSG_GK20A_H */ |