diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 29 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/hw_gr_gp10b.h | 52 |
2 files changed, 81 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index 240bab81..973653a0 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c | |||
@@ -844,6 +844,34 @@ static int gr_gp10b_wait_empty(struct gk20a *g, unsigned long end_jiffies, | |||
844 | return -EAGAIN; | 844 | return -EAGAIN; |
845 | } | 845 | } |
846 | 846 | ||
847 | static void gr_gp10b_commit_global_attrib_cb(struct gk20a *g, | ||
848 | struct channel_ctx_gk20a *ch_ctx, | ||
849 | u64 addr, bool patch) | ||
850 | { | ||
851 | struct gr_ctx_desc *gr_ctx = ch_ctx->gr_ctx; | ||
852 | int attrBufferSize; | ||
853 | |||
854 | if (gr_ctx->t18x.preempt_ctxsw_buffer.gpu_va) | ||
855 | attrBufferSize = gr_ctx->t18x.preempt_ctxsw_buffer.size; | ||
856 | else | ||
857 | attrBufferSize = g->ops.gr.calc_global_ctx_buffer_size(g); | ||
858 | |||
859 | attrBufferSize /= gr_gpcs_tpcs_tex_rm_cb_1_size_div_128b_granularity_f(); | ||
860 | |||
861 | gr_gm20b_commit_global_attrib_cb(g, ch_ctx, addr, patch); | ||
862 | |||
863 | gr_gk20a_ctx_patch_write(g, ch_ctx, gr_gpcs_tpcs_mpc_vtg_cb_global_base_addr_r(), | ||
864 | gr_gpcs_tpcs_mpc_vtg_cb_global_base_addr_v_f(addr) | | ||
865 | gr_gpcs_tpcs_mpc_vtg_cb_global_base_addr_valid_true_f(), patch); | ||
866 | |||
867 | gr_gk20a_ctx_patch_write(g, ch_ctx, gr_gpcs_tpcs_tex_rm_cb_0_r(), | ||
868 | gr_gpcs_tpcs_tex_rm_cb_0_base_addr_43_12_f(addr), patch); | ||
869 | |||
870 | gr_gk20a_ctx_patch_write(g, ch_ctx, gr_gpcs_tpcs_tex_rm_cb_1_r(), | ||
871 | gr_gpcs_tpcs_tex_rm_cb_1_size_div_128b_f(attrBufferSize) | | ||
872 | gr_gpcs_tpcs_tex_rm_cb_1_valid_true_f(), patch); | ||
873 | } | ||
874 | |||
847 | void gp10b_init_gr(struct gpu_ops *gops) | 875 | void gp10b_init_gr(struct gpu_ops *gops) |
848 | { | 876 | { |
849 | gm20b_init_gr(gops); | 877 | gm20b_init_gr(gops); |
@@ -855,6 +883,7 @@ void gp10b_init_gr(struct gpu_ops *gops) | |||
855 | gops->gr.pagepool_default_size = gr_gp10b_pagepool_default_size; | 883 | gops->gr.pagepool_default_size = gr_gp10b_pagepool_default_size; |
856 | gops->gr.calc_global_ctx_buffer_size = | 884 | gops->gr.calc_global_ctx_buffer_size = |
857 | gr_gp10b_calc_global_ctx_buffer_size; | 885 | gr_gp10b_calc_global_ctx_buffer_size; |
886 | gops->gr.commit_global_attrib_cb = gr_gp10b_commit_global_attrib_cb; | ||
858 | gops->gr.handle_sw_method = gr_gp10b_handle_sw_method; | 887 | gops->gr.handle_sw_method = gr_gp10b_handle_sw_method; |
859 | gops->gr.cb_size_default = gr_gp10b_cb_size_default; | 888 | gops->gr.cb_size_default = gr_gp10b_cb_size_default; |
860 | gops->gr.set_alpha_circular_buffer_size = | 889 | gops->gr.set_alpha_circular_buffer_size = |
diff --git a/drivers/gpu/nvgpu/gp10b/hw_gr_gp10b.h b/drivers/gpu/nvgpu/gp10b/hw_gr_gp10b.h index b185604e..32903fba 100644 --- a/drivers/gpu/nvgpu/gp10b/hw_gr_gp10b.h +++ b/drivers/gpu/nvgpu/gp10b/hw_gr_gp10b.h | |||
@@ -2206,6 +2206,58 @@ static inline u32 gr_gpc0_ppc0_cbm_beta_steady_state_cb_size_v_default_v(void) | |||
2206 | { | 2206 | { |
2207 | return 0x00030000; | 2207 | return 0x00030000; |
2208 | } | 2208 | } |
2209 | static inline u32 gr_gpcs_tpcs_tex_rm_cb_0_r(void) | ||
2210 | { | ||
2211 | return 0x00419b00; | ||
2212 | } | ||
2213 | static inline u32 gr_gpcs_tpcs_tex_rm_cb_0_base_addr_43_12_f(u32 v) | ||
2214 | { | ||
2215 | return (v & 0xffffffff) << 0; | ||
2216 | } | ||
2217 | static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_r(void) | ||
2218 | { | ||
2219 | return 0x00419b04; | ||
2220 | } | ||
2221 | static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_size_div_128b_s(void) | ||
2222 | { | ||
2223 | return 21; | ||
2224 | } | ||
2225 | static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_size_div_128b_f(u32 v) | ||
2226 | { | ||
2227 | return (v & 0x1fffff) << 0; | ||
2228 | } | ||
2229 | static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_size_div_128b_m(void) | ||
2230 | { | ||
2231 | return 0x1fffff << 0; | ||
2232 | } | ||
2233 | static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_size_div_128b_v(u32 r) | ||
2234 | { | ||
2235 | return (r >> 0) & 0x1fffff; | ||
2236 | } | ||
2237 | static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_size_div_128b_granularity_f(void) | ||
2238 | { | ||
2239 | return 0x80; | ||
2240 | } | ||
2241 | static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_valid_s(void) | ||
2242 | { | ||
2243 | return 1; | ||
2244 | } | ||
2245 | static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_valid_f(u32 v) | ||
2246 | { | ||
2247 | return (v & 0x1) << 31; | ||
2248 | } | ||
2249 | static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_valid_m(void) | ||
2250 | { | ||
2251 | return 0x1 << 31; | ||
2252 | } | ||
2253 | static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_valid_v(u32 r) | ||
2254 | { | ||
2255 | return (r >> 31) & 0x1; | ||
2256 | } | ||
2257 | static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_valid_true_f(void) | ||
2258 | { | ||
2259 | return 0x80000000; | ||
2260 | } | ||
2209 | static inline u32 gr_gpccs_falcon_addr_r(void) | 2261 | static inline u32 gr_gpccs_falcon_addr_r(void) |
2210 | { | 2262 | { |
2211 | return 0x0041a0ac; | 2263 | return 0x0041a0ac; |