summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu
diff options
context:
space:
mode:
authorseshendra Gadagottu <sgadagottu@nvidia.com>2017-01-11 17:28:32 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-01-18 19:47:20 -0500
commit64ab12979590564db19c820ff8cdd71579a9b317 (patch)
treeaa042293a77dd5f63b552ad04b6b536492b36f8d /drivers/gpu/nvgpu
parent3f0e08da43a448d8a1a85529b03d4c073f8c11c5 (diff)
gpu: nvgpu: gv11b: sw methods for shader exception
Added proper sw methods handling of shader execptions for gv11b. Bug 1834201 Change-Id: I3f3a45beed777cc4af59368dccd9dc7bb8181c37 Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: http://git-master/r/1283729 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r--drivers/gpu/nvgpu/gv11b/gr_gv11b.c23
-rw-r--r--drivers/gpu/nvgpu/gv11b/gr_gv11b.h2
-rw-r--r--drivers/gpu/nvgpu/gv11b/hw_gr_gv11b.h10
3 files changed, 32 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
index 4984af46..79eee0e5 100644
--- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
@@ -407,6 +407,25 @@ static void gr_gv11b_set_coalesce_buffer_size(struct gk20a *g, u32 data)
407 gk20a_dbg_fn("done"); 407 gk20a_dbg_fn("done");
408} 408}
409 409
410
411static void gv11b_gr_set_shader_exceptions(struct gk20a *g, u32 data)
412{
413 u32 val;
414
415 gk20a_dbg_fn("");
416
417 if (data == NVA297_SET_SHADER_EXCEPTIONS_ENABLE_FALSE)
418 val = 0;
419 else
420 val = 0xffffffff;
421
422 /* setup sm warp esr report masks */
423 gk20a_writel(g, gr_gpcs_tpcs_sms_hww_warp_esr_report_mask_r(), val);
424
425 /* setup sm global esr report mask */
426 gk20a_writel(g, gr_gpcs_tpcs_sms_hww_global_esr_report_mask_r(), val);
427}
428
410static int gr_gv11b_handle_sw_method(struct gk20a *g, u32 addr, 429static int gr_gv11b_handle_sw_method(struct gk20a *g, u32 addr,
411 u32 class_num, u32 offset, u32 data) 430 u32 class_num, u32 offset, u32 data)
412{ 431{
@@ -415,7 +434,7 @@ static int gr_gv11b_handle_sw_method(struct gk20a *g, u32 addr,
415 if (class_num == VOLTA_COMPUTE_A) { 434 if (class_num == VOLTA_COMPUTE_A) {
416 switch (offset << 2) { 435 switch (offset << 2) {
417 case NVC0C0_SET_SHADER_EXCEPTIONS: 436 case NVC0C0_SET_SHADER_EXCEPTIONS:
418 gk20a_gr_set_shader_exceptions(g, data); 437 gv11b_gr_set_shader_exceptions(g, data);
419 break; 438 break;
420 default: 439 default:
421 goto fail; 440 goto fail;
@@ -425,7 +444,7 @@ static int gr_gv11b_handle_sw_method(struct gk20a *g, u32 addr,
425 if (class_num == VOLTA_A) { 444 if (class_num == VOLTA_A) {
426 switch (offset << 2) { 445 switch (offset << 2) {
427 case NVC397_SET_SHADER_EXCEPTIONS: 446 case NVC397_SET_SHADER_EXCEPTIONS:
428 gk20a_gr_set_shader_exceptions(g, data); 447 gv11b_gr_set_shader_exceptions(g, data);
429 break; 448 break;
430 case NVC397_SET_CIRCULAR_BUFFER_SIZE: 449 case NVC397_SET_CIRCULAR_BUFFER_SIZE:
431 g->ops.gr.set_circular_buffer_size(g, data); 450 g->ops.gr.set_circular_buffer_size(g, data);
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h
index d31c92ca..b2549edd 100644
--- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h
+++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h
@@ -43,6 +43,8 @@ enum {
43#define NVC397_SET_ALPHA_CIRCULAR_BUFFER_SIZE 0x02dc 43#define NVC397_SET_ALPHA_CIRCULAR_BUFFER_SIZE 0x02dc
44#define NVC397_SET_GO_IDLE_TIMEOUT 0x022c 44#define NVC397_SET_GO_IDLE_TIMEOUT 0x022c
45 45
46#define NVA297_SET_SHADER_EXCEPTIONS_ENABLE_FALSE 0
47
46void gv11b_init_gr(struct gpu_ops *ops); 48void gv11b_init_gr(struct gpu_ops *ops);
47int gr_gv11b_alloc_buffer(struct vm_gk20a *vm, size_t size, 49int gr_gv11b_alloc_buffer(struct vm_gk20a *vm, size_t size,
48 struct mem_desc *mem); 50 struct mem_desc *mem);
diff --git a/drivers/gpu/nvgpu/gv11b/hw_gr_gv11b.h b/drivers/gpu/nvgpu/gv11b/hw_gr_gv11b.h
index 99da5f73..656597ba 100644
--- a/drivers/gpu/nvgpu/gv11b/hw_gr_gv11b.h
+++ b/drivers/gpu/nvgpu/gv11b/hw_gr_gv11b.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -554,6 +554,14 @@ static inline u32 gr_fe_hww_esr_en_enable_f(void)
554{ 554{
555 return 0x80000000; 555 return 0x80000000;
556} 556}
557static inline u32 gr_gpcs_tpcs_sms_hww_warp_esr_report_mask_r(void)
558{
559 return 0x00419ea8;
560}
561static inline u32 gr_gpcs_tpcs_sms_hww_global_esr_report_mask_r(void)
562{
563 return 0x00419eac;
564}
557static inline u32 gr_fe_go_idle_timeout_r(void) 565static inline u32 gr_fe_go_idle_timeout_r(void)
558{ 566{
559 return 0x00404154; 567 return 0x00404154;