From e5161d1518e227050f94213e6615f8b35a5fb115 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 21 Nov 2014 14:15:13 +0200 Subject: gpu: nvgpu: gp10b: Implement SW methods Bug 1567274 Change-Id: I6d760eca7ac0931847f9a04a9d4a408519ade511 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/654098 --- drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 37 +++++++++++++++++++++++++++++++++++++ drivers/gpu/nvgpu/gp10b/gr_gp10b.h | 6 +++++- 2 files changed, 42 insertions(+), 1 deletion(-) (limited to 'drivers') 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) return size; } +static int gr_gp10b_handle_sw_method(struct gk20a *g, u32 addr, + u32 class_num, u32 offset, u32 data) +{ + gk20a_dbg_fn(""); + + if (class_num == PASCAL_COMPUTE_A) { + switch (offset << 2) { + case NVC0C0_SET_SHADER_EXCEPTIONS: + gk20a_gr_set_shader_exceptions(g, data); + break; + default: + goto fail; + } + } + + if (class_num == PASCAL_A) { + switch (offset << 2) { + case NVC097_SET_SHADER_EXCEPTIONS: + gk20a_gr_set_shader_exceptions(g, data); + break; + case NVC097_SET_CIRCULAR_BUFFER_SIZE: + g->ops.gr.set_circular_buffer_size(g, data); + break; + case NVC097_SET_ALPHA_CIRCULAR_BUFFER_SIZE: + g->ops.gr.set_alpha_circular_buffer_size(g, data); + break; + default: + goto fail; + } + } + return 0; + +fail: + return -EINVAL; +} + void gp10b_init_gr(struct gpu_ops *gops) { gm20b_init_gr(gops); @@ -344,4 +380,5 @@ void gp10b_init_gr(struct gpu_ops *gops) gops->gr.buffer_size_defaults = gr_gp10b_buffer_size_defaults; gops->gr.calc_global_ctx_buffer_size = gr_gp10b_calc_global_ctx_buffer_size; + gops->gr.handle_sw_method = gr_gp10b_handle_sw_method; } 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 { PASCAL_DMA_COPY_A = 0xC0B5, }; -void gp10b_init_gr(struct gpu_ops *ops); +#define NVC097_SET_ALPHA_CIRCULAR_BUFFER_SIZE 0x02dc +#define NVC097_SET_CIRCULAR_BUFFER_SIZE 0x1280 +#define NVC097_SET_SHADER_EXCEPTIONS 0x1528 +#define NVC0C0_SET_SHADER_EXCEPTIONS 0x1528 +void gp10b_init_gr(struct gpu_ops *ops); #endif -- cgit v1.2.2