diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 3354c05e..2c7423c0 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -58,7 +58,6 @@ | |||
58 | #include "semaphore_gk20a.h" | 58 | #include "semaphore_gk20a.h" |
59 | #include "platform_gk20a.h" | 59 | #include "platform_gk20a.h" |
60 | #include "ctxsw_trace_gk20a.h" | 60 | #include "ctxsw_trace_gk20a.h" |
61 | #include "hw_proj_gk20a.h" | ||
62 | 61 | ||
63 | #define BLK_SIZE (256) | 62 | #define BLK_SIZE (256) |
64 | #define NV_PMM_FBP_STRIDE 0x1000 | 63 | #define NV_PMM_FBP_STRIDE 0x1000 |
@@ -5513,8 +5512,10 @@ static int gk20a_gr_record_sm_error_state(struct gk20a *g, u32 gpc, u32 tpc) | |||
5513 | { | 5512 | { |
5514 | int sm_id; | 5513 | int sm_id; |
5515 | struct gr_gk20a *gr = &g->gr; | 5514 | struct gr_gk20a *gr = &g->gr; |
5516 | u32 offset = proj_gpc_stride_v() * gpc + | 5515 | u32 gpc_stride = nvgpu_get_litter_value(g, GPU_LIT_GPC_STRIDE); |
5517 | proj_tpc_in_gpc_stride_v() * tpc; | 5516 | u32 tpc_in_gpc_stride = nvgpu_get_litter_value(g, |
5517 | GPU_LIT_TPC_IN_GPC_STRIDE); | ||
5518 | u32 offset = gpc_stride * gpc + tpc_in_gpc_stride * tpc; | ||
5518 | 5519 | ||
5519 | mutex_lock(&g->dbg_sessions_lock); | 5520 | mutex_lock(&g->dbg_sessions_lock); |
5520 | 5521 | ||
@@ -5542,6 +5543,9 @@ static int gk20a_gr_update_sm_error_state(struct gk20a *g, | |||
5542 | u32 gpc, tpc, offset; | 5543 | u32 gpc, tpc, offset; |
5543 | struct gr_gk20a *gr = &g->gr; | 5544 | struct gr_gk20a *gr = &g->gr; |
5544 | struct channel_ctx_gk20a *ch_ctx = &ch->ch_ctx; | 5545 | struct channel_ctx_gk20a *ch_ctx = &ch->ch_ctx; |
5546 | u32 gpc_stride = nvgpu_get_litter_value(g, GPU_LIT_GPC_STRIDE); | ||
5547 | u32 tpc_in_gpc_stride = nvgpu_get_litter_value(g, | ||
5548 | GPU_LIT_TPC_IN_GPC_STRIDE); | ||
5545 | int err = 0; | 5549 | int err = 0; |
5546 | 5550 | ||
5547 | mutex_lock(&g->dbg_sessions_lock); | 5551 | mutex_lock(&g->dbg_sessions_lock); |
@@ -5564,8 +5568,7 @@ static int gk20a_gr_update_sm_error_state(struct gk20a *g, | |||
5564 | gpc = g->gr.sm_to_cluster[sm_id].gpc_index; | 5568 | gpc = g->gr.sm_to_cluster[sm_id].gpc_index; |
5565 | tpc = g->gr.sm_to_cluster[sm_id].tpc_index; | 5569 | tpc = g->gr.sm_to_cluster[sm_id].tpc_index; |
5566 | 5570 | ||
5567 | offset = proj_gpc_stride_v() * gpc + | 5571 | offset = gpc_stride * gpc + tpc_in_gpc_stride * tpc; |
5568 | proj_tpc_in_gpc_stride_v() * tpc; | ||
5569 | 5572 | ||
5570 | if (gk20a_is_channel_ctx_resident(ch)) { | 5573 | if (gk20a_is_channel_ctx_resident(ch)) { |
5571 | gk20a_writel(g, gr_gpc0_tpc0_sm_hww_global_esr_r() + offset, | 5574 | gk20a_writel(g, gr_gpc0_tpc0_sm_hww_global_esr_r() + offset, |
@@ -5607,6 +5610,9 @@ static int gk20a_gr_clear_sm_error_state(struct gk20a *g, | |||
5607 | u32 gpc, tpc, offset; | 5610 | u32 gpc, tpc, offset; |
5608 | u32 val; | 5611 | u32 val; |
5609 | struct gr_gk20a *gr = &g->gr; | 5612 | struct gr_gk20a *gr = &g->gr; |
5613 | u32 gpc_stride = nvgpu_get_litter_value(g, GPU_LIT_GPC_STRIDE); | ||
5614 | u32 tpc_in_gpc_stride = nvgpu_get_litter_value(g, | ||
5615 | GPU_LIT_TPC_IN_GPC_STRIDE); | ||
5610 | int err = 0; | 5616 | int err = 0; |
5611 | 5617 | ||
5612 | mutex_lock(&g->dbg_sessions_lock); | 5618 | mutex_lock(&g->dbg_sessions_lock); |
@@ -5623,8 +5629,7 @@ static int gk20a_gr_clear_sm_error_state(struct gk20a *g, | |||
5623 | gpc = g->gr.sm_to_cluster[sm_id].gpc_index; | 5629 | gpc = g->gr.sm_to_cluster[sm_id].gpc_index; |
5624 | tpc = g->gr.sm_to_cluster[sm_id].tpc_index; | 5630 | tpc = g->gr.sm_to_cluster[sm_id].tpc_index; |
5625 | 5631 | ||
5626 | offset = proj_gpc_stride_v() * gpc + | 5632 | offset = gpc_stride * gpc + tpc_in_gpc_stride * tpc; |
5627 | proj_tpc_in_gpc_stride_v() * tpc; | ||
5628 | 5633 | ||
5629 | val = gk20a_readl(g, gr_gpc0_tpc0_sm_hww_global_esr_r() + offset); | 5634 | val = gk20a_readl(g, gr_gpc0_tpc0_sm_hww_global_esr_r() + offset); |
5630 | gk20a_writel(g, gr_gpc0_tpc0_sm_hww_global_esr_r() + offset, | 5635 | gk20a_writel(g, gr_gpc0_tpc0_sm_hww_global_esr_r() + offset, |