summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.c37
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.h6
2 files changed, 42 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
index b8fbc28e..844ba81f 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
@@ -333,6 +333,42 @@ static int gr_gp10b_calc_global_ctx_buffer_size(struct gk20a *g)
333 return size; 333 return size;
334} 334}
335 335
336static int gr_gp10b_handle_sw_method(struct gk20a *g, u32 addr,
337 u32 class_num, u32 offset, u32 data)
338{
339 gk20a_dbg_fn("");
340
341 if (class_num == PASCAL_COMPUTE_A) {
342 switch (offset << 2) {
343 case NVC0C0_SET_SHADER_EXCEPTIONS:
344 gk20a_gr_set_shader_exceptions(g, data);
345 break;
346 default:
347 goto fail;
348 }
349 }
350
351 if (class_num == PASCAL_A) {
352 switch (offset << 2) {
353 case NVC097_SET_SHADER_EXCEPTIONS:
354 gk20a_gr_set_shader_exceptions(g, data);
355 break;
356 case NVC097_SET_CIRCULAR_BUFFER_SIZE:
357 g->ops.gr.set_circular_buffer_size(g, data);
358 break;
359 case NVC097_SET_ALPHA_CIRCULAR_BUFFER_SIZE:
360 g->ops.gr.set_alpha_circular_buffer_size(g, data);
361 break;
362 default:
363 goto fail;
364 }
365 }
366 return 0;
367
368fail:
369 return -EINVAL;
370}
371
336void gp10b_init_gr(struct gpu_ops *gops) 372void gp10b_init_gr(struct gpu_ops *gops)
337{ 373{
338 gm20b_init_gr(gops); 374 gm20b_init_gr(gops);
@@ -344,4 +380,5 @@ void gp10b_init_gr(struct gpu_ops *gops)
344 gops->gr.buffer_size_defaults = gr_gp10b_buffer_size_defaults; 380 gops->gr.buffer_size_defaults = gr_gp10b_buffer_size_defaults;
345 gops->gr.calc_global_ctx_buffer_size = 381 gops->gr.calc_global_ctx_buffer_size =
346 gr_gp10b_calc_global_ctx_buffer_size; 382 gr_gp10b_calc_global_ctx_buffer_size;
383 gops->gr.handle_sw_method = gr_gp10b_handle_sw_method;
347} 384}
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.h b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h
index 58616deb..536a7d27 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.h
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h
@@ -25,7 +25,11 @@ enum {
25 PASCAL_DMA_COPY_A = 0xC0B5, 25 PASCAL_DMA_COPY_A = 0xC0B5,
26}; 26};
27 27
28void gp10b_init_gr(struct gpu_ops *ops); 28#define NVC097_SET_ALPHA_CIRCULAR_BUFFER_SIZE 0x02dc
29#define NVC097_SET_CIRCULAR_BUFFER_SIZE 0x1280
30#define NVC097_SET_SHADER_EXCEPTIONS 0x1528
31#define NVC0C0_SET_SHADER_EXCEPTIONS 0x1528
29 32
33void gp10b_init_gr(struct gpu_ops *ops);
30 34
31#endif 35#endif