summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2016-12-14 17:43:42 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-01-05 12:13:30 -0500
commitea5a2147229e32f0524827af82cb7a880aca6296 (patch)
tree57502c753df7efec4924f9969eb2aebca347c304 /drivers/gpu/nvgpu
parent5711e2b1f7c3a34444c654e7a3bf0a6f8201ef03 (diff)
gpu: nvgpu: Implement SET_RD_COALESCE
Implement SW method SET_RD_COALESCE to implement correct handling of texture read coalescing. Bug 200223870 Change-Id: Icd6f987b72d78e5add4076fc550e2070eba70628 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1271303 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r--drivers/gpu/nvgpu/gm20b/gr_gm20b.c22
-rw-r--r--drivers/gpu/nvgpu/gm20b/gr_gm20b.h5
-rw-r--r--drivers/gpu/nvgpu/gm20b/hw_gr_gm20b.h14
-rw-r--r--drivers/gpu/nvgpu/gp106/gr_gp106.c8
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.c8
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.h4
6 files changed, 55 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
index fc98b5ca..c74b9fec 100644
--- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GM20B GPC MMU 2 * GM20B GPC MMU
3 * 3 *
4 * Copyright (c) 2011-2016, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -262,6 +262,20 @@ static void gr_gm20b_commit_global_pagepool(struct gk20a *g,
262 262
263} 263}
264 264
265void gr_gm20b_set_rd_coalesce(struct gk20a *g, u32 data)
266{
267 u32 val;
268
269 gk20a_dbg_fn("");
270
271 val = gk20a_readl(g, gr_gpcs_tpcs_tex_m_dbg2_r());
272 val = set_field(val, gr_gpcs_tpcs_tex_m_dbg2_lg_rd_coalesce_en_m(),
273 gr_gpcs_tpcs_tex_m_dbg2_lg_rd_coalesce_en_f(data));
274 gk20a_writel(g, gr_gpcs_tpcs_tex_m_dbg2_r(), val);
275
276 gk20a_dbg_fn("done");
277}
278
265static int gr_gm20b_handle_sw_method(struct gk20a *g, u32 addr, 279static int gr_gm20b_handle_sw_method(struct gk20a *g, u32 addr,
266 u32 class_num, u32 offset, u32 data) 280 u32 class_num, u32 offset, u32 data)
267{ 281{
@@ -272,6 +286,9 @@ static int gr_gm20b_handle_sw_method(struct gk20a *g, u32 addr,
272 case NVB1C0_SET_SHADER_EXCEPTIONS: 286 case NVB1C0_SET_SHADER_EXCEPTIONS:
273 gk20a_gr_set_shader_exceptions(g, data); 287 gk20a_gr_set_shader_exceptions(g, data);
274 break; 288 break;
289 case NVB1C0_SET_RD_COALESCE:
290 gr_gm20b_set_rd_coalesce(g, data);
291 break;
275 default: 292 default:
276 goto fail; 293 goto fail;
277 } 294 }
@@ -288,6 +305,9 @@ static int gr_gm20b_handle_sw_method(struct gk20a *g, u32 addr,
288 case NVB197_SET_ALPHA_CIRCULAR_BUFFER_SIZE: 305 case NVB197_SET_ALPHA_CIRCULAR_BUFFER_SIZE:
289 g->ops.gr.set_alpha_circular_buffer_size(g, data); 306 g->ops.gr.set_alpha_circular_buffer_size(g, data);
290 break; 307 break;
308 case NVB197_SET_RD_COALESCE:
309 gr_gm20b_set_rd_coalesce(g, data);
310 break;
291 default: 311 default:
292 goto fail; 312 goto fail;
293 } 313 }
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.h b/drivers/gpu/nvgpu/gm20b/gr_gm20b.h
index a1aef80b..b94259c5 100644
--- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.h
+++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * GM20B GPC MMU 2 * GM20B GPC MMU
3 * 3 *
4 * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -39,7 +39,9 @@ enum {
39#define NVB197_SET_ALPHA_CIRCULAR_BUFFER_SIZE 0x02dc 39#define NVB197_SET_ALPHA_CIRCULAR_BUFFER_SIZE 0x02dc
40#define NVB197_SET_CIRCULAR_BUFFER_SIZE 0x1280 40#define NVB197_SET_CIRCULAR_BUFFER_SIZE 0x1280
41#define NVB197_SET_SHADER_EXCEPTIONS 0x1528 41#define NVB197_SET_SHADER_EXCEPTIONS 0x1528
42#define NVB197_SET_RD_COALESCE 0x102c
42#define NVB1C0_SET_SHADER_EXCEPTIONS 0x1528 43#define NVB1C0_SET_SHADER_EXCEPTIONS 0x1528
44#define NVB1C0_SET_RD_COALESCE 0x0228
43 45
44#define NVA297_SET_SHADER_EXCEPTIONS_ENABLE_FALSE 0 46#define NVA297_SET_SHADER_EXCEPTIONS_ENABLE_FALSE 0
45void gm20b_init_gr(struct gpu_ops *gops); 47void gm20b_init_gr(struct gpu_ops *gops);
@@ -48,5 +50,6 @@ void gr_gm20b_commit_global_attrib_cb(struct gk20a *g,
48 u64 addr, bool patch); 50 u64 addr, bool patch);
49int gr_gm20b_init_fs_state(struct gk20a *g); 51int gr_gm20b_init_fs_state(struct gk20a *g);
50int gm20b_gr_tpc_disable_override(struct gk20a *g, u32 mask); 52int gm20b_gr_tpc_disable_override(struct gk20a *g, u32 mask);
53void gr_gm20b_set_rd_coalesce(struct gk20a *g, u32 data);
51 54
52#endif 55#endif
diff --git a/drivers/gpu/nvgpu/gm20b/hw_gr_gm20b.h b/drivers/gpu/nvgpu/gm20b/hw_gr_gm20b.h
index 68b5a6d4..9f7fea45 100644
--- a/drivers/gpu/nvgpu/gm20b/hw_gr_gm20b.h
+++ b/drivers/gpu/nvgpu/gm20b/hw_gr_gm20b.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2014-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,
@@ -2254,6 +2254,18 @@ static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_offset_r(void)
2254{ 2254{
2255 return 0x005030f8; 2255 return 0x005030f8;
2256} 2256}
2257static inline u32 gr_gpcs_tpcs_tex_m_dbg2_r(void)
2258{
2259 return 0x00419a3c;
2260}
2261static inline u32 gr_gpcs_tpcs_tex_m_dbg2_lg_rd_coalesce_en_f(u32 v)
2262{
2263 return (v & 0x1) << 2;
2264}
2265static inline u32 gr_gpcs_tpcs_tex_m_dbg2_lg_rd_coalesce_en_m(void)
2266{
2267 return 0x1 << 2;
2268}
2257static inline u32 gr_gpccs_falcon_addr_r(void) 2269static inline u32 gr_gpccs_falcon_addr_r(void)
2258{ 2270{
2259 return 0x0041a0ac; 2271 return 0x0041a0ac;
diff --git a/drivers/gpu/nvgpu/gp106/gr_gp106.c b/drivers/gpu/nvgpu/gp106/gr_gp106.c
index 8d8376d3..cbcb5981 100644
--- a/drivers/gpu/nvgpu/gp106/gr_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/gr_gp106.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GP106 GPU GR 2 * GP106 GPU GR
3 * 3 *
4 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -71,6 +71,9 @@ static int gr_gp106_handle_sw_method(struct gk20a *g, u32 addr,
71 case NVC0C0_SET_SHADER_EXCEPTIONS: 71 case NVC0C0_SET_SHADER_EXCEPTIONS:
72 gk20a_gr_set_shader_exceptions(g, data); 72 gk20a_gr_set_shader_exceptions(g, data);
73 break; 73 break;
74 case NVC0C0_SET_RD_COALESCE:
75 gr_gm20b_set_rd_coalesce(g, data);
76 break;
74 default: 77 default:
75 goto fail; 78 goto fail;
76 } 79 }
@@ -90,6 +93,9 @@ static int gr_gp106_handle_sw_method(struct gk20a *g, u32 addr,
90 case NVC097_SET_GO_IDLE_TIMEOUT: 93 case NVC097_SET_GO_IDLE_TIMEOUT:
91 gr_gp106_set_go_idle_timeout(g, data); 94 gr_gp106_set_go_idle_timeout(g, data);
92 break; 95 break;
96 case NVC097_SET_RD_COALESCE:
97 gr_gm20b_set_rd_coalesce(g, data);
98 break;
93 default: 99 default:
94 goto fail; 100 goto fail;
95 } 101 }
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
index 9de7d675..45820c5c 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GP10B GPU GR 2 * GP10B GPU GR
3 * 3 *
4 * Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -629,6 +629,9 @@ static int gr_gp10b_handle_sw_method(struct gk20a *g, u32 addr,
629 case NVC0C0_SET_SHADER_EXCEPTIONS: 629 case NVC0C0_SET_SHADER_EXCEPTIONS:
630 gk20a_gr_set_shader_exceptions(g, data); 630 gk20a_gr_set_shader_exceptions(g, data);
631 break; 631 break;
632 case NVC0C0_SET_RD_COALESCE:
633 gr_gm20b_set_rd_coalesce(g, data);
634 break;
632 default: 635 default:
633 goto fail; 636 goto fail;
634 } 637 }
@@ -651,6 +654,9 @@ static int gr_gp10b_handle_sw_method(struct gk20a *g, u32 addr,
651 case NVC097_SET_COALESCE_BUFFER_SIZE: 654 case NVC097_SET_COALESCE_BUFFER_SIZE:
652 gr_gp10b_set_coalesce_buffer_size(g, data); 655 gr_gp10b_set_coalesce_buffer_size(g, data);
653 break; 656 break;
657 case NVC097_SET_RD_COALESCE:
658 gr_gm20b_set_rd_coalesce(g, data);
659 break;
654 default: 660 default:
655 goto fail; 661 goto fail;
656 } 662 }
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.h b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h
index 5338789f..0a70903f 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.h
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * GP10B GPU GR 2 * GP10B GPU GR
3 * 3 *
4 * Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -31,9 +31,11 @@ enum {
31#define NVC097_SET_GO_IDLE_TIMEOUT 0x022c 31#define NVC097_SET_GO_IDLE_TIMEOUT 0x022c
32#define NVC097_SET_ALPHA_CIRCULAR_BUFFER_SIZE 0x02dc 32#define NVC097_SET_ALPHA_CIRCULAR_BUFFER_SIZE 0x02dc
33#define NVC097_SET_COALESCE_BUFFER_SIZE 0x1028 33#define NVC097_SET_COALESCE_BUFFER_SIZE 0x1028
34#define NVC097_SET_RD_COALESCE 0x102c
34#define NVC097_SET_CIRCULAR_BUFFER_SIZE 0x1280 35#define NVC097_SET_CIRCULAR_BUFFER_SIZE 0x1280
35#define NVC097_SET_SHADER_EXCEPTIONS 0x1528 36#define NVC097_SET_SHADER_EXCEPTIONS 0x1528
36#define NVC0C0_SET_SHADER_EXCEPTIONS 0x1528 37#define NVC0C0_SET_SHADER_EXCEPTIONS 0x1528
38#define NVC0C0_SET_RD_COALESCE 0x0228
37 39
38void gp10b_init_gr(struct gpu_ops *ops); 40void gp10b_init_gr(struct gpu_ops *ops);
39int gr_gp10b_init_fs_state(struct gk20a *g); 41int gr_gp10b_init_fs_state(struct gk20a *g);