diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h index a7656d38..88521555 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h | |||
@@ -69,6 +69,35 @@ static inline u32 pri_get_gpc_num(struct gk20a *g, u32 addr) | |||
69 | } | 69 | } |
70 | return 0; | 70 | return 0; |
71 | } | 71 | } |
72 | |||
73 | /* | ||
74 | * PPC pri addressing | ||
75 | */ | ||
76 | static inline bool pri_is_ppc_addr_shared(struct gk20a *g, u32 addr) | ||
77 | { | ||
78 | u32 ppc_in_gpc_shared_base = nvgpu_get_litter_value(g, | ||
79 | GPU_LIT_PPC_IN_GPC_SHARED_BASE); | ||
80 | u32 ppc_in_gpc_stride = nvgpu_get_litter_value(g, | ||
81 | GPU_LIT_PPC_IN_GPC_STRIDE); | ||
82 | |||
83 | return ((addr >= ppc_in_gpc_shared_base) && | ||
84 | (addr < (ppc_in_gpc_shared_base + ppc_in_gpc_stride))); | ||
85 | } | ||
86 | |||
87 | static inline bool pri_is_ppc_addr(struct gk20a *g, u32 addr) | ||
88 | { | ||
89 | u32 ppc_in_gpc_base = nvgpu_get_litter_value(g, | ||
90 | GPU_LIT_PPC_IN_GPC_BASE); | ||
91 | u32 num_pes_per_gpc = nvgpu_get_litter_value(g, | ||
92 | GPU_LIT_NUM_PES_PER_GPC); | ||
93 | u32 ppc_in_gpc_stride = nvgpu_get_litter_value(g, | ||
94 | GPU_LIT_PPC_IN_GPC_STRIDE); | ||
95 | |||
96 | return ((addr >= ppc_in_gpc_base) && | ||
97 | (addr < ppc_in_gpc_base + num_pes_per_gpc * ppc_in_gpc_stride)) | ||
98 | || pri_is_ppc_addr_shared(g, addr); | ||
99 | } | ||
100 | |||
72 | /* | 101 | /* |
73 | * TPC pri addressing | 102 | * TPC pri addressing |
74 | */ | 103 | */ |